I have tried various things to create a custom style using the pattern that Anthony provided and I can set the header to a different grayscale header to represent that the WebListbox is disabled, but it also changes the body color and I have been unsuccessful at finding a setting that will give me all the normal formatting the same as normal with only the header background image gradient changed.
Any of the CSS gurus have any advice? Am I approaching this wrong or just missing the necessary style parameters to make the style identical to normal except for the header?
Here’s my solution to preserve all of the previous styling and apply a disabled state to the header (and set the table’s Enabled property).
Add the following method to a module (as I assume you’ll be using this in multiple places, it makes the most sense to create an extension method):
Public Sub setEnabled(extends l as WebListBox, value as Boolean)
l.Enabled = value
l.ExecuteJavaScript( "$('#" + l.ControlID + "')." + if( l.Enabled, "remove", "add" ) + "Class('disabledTable');" )
End Sub
Thanks again to both of you! I tested Alberto’s solution and that works. It didn’t occur to me to not include the other lines Anthony used in the borderless solution. I’ll try Anthony’s solution here in a bit to see how that works too. That would be a handy way to change a WebListbox enabled/disabled state appearance. I don’t necessarily need it for this particular instance, but it’s nice to have that option as I progress on this particular project.