J
Johno
I'm developing a set of WebControls that can be toggled between Readwrite and
Readonly modes. They are each inherited from their standard webcontrol but
implement an IReadOnly interface and override the Render method to render the
control as readonly. So for exemple, I'm rendering checkboxes as themselves
in read/write mode and as an <IMG src="checkbox.gif"/> in read-only mode. All
works fine but I'm stuck on the ListBox control. My approach to this has been
to render the readonly ListBox as a fixed-height and width <UL> containing
<LI>s with the selected list items displayed with the highlight color. But
here's the issue: how do I determine the height and width of the <UL> for
rendering? I could rely on the control user to explicitly set the height and
width properties of the Readwrite/ReadOnly ListBox descendent but that
solution is far from satisfactory.
Any ideas on how I can get around this problem?
TIA
Johno
Readonly modes. They are each inherited from their standard webcontrol but
implement an IReadOnly interface and override the Render method to render the
control as readonly. So for exemple, I'm rendering checkboxes as themselves
in read/write mode and as an <IMG src="checkbox.gif"/> in read-only mode. All
works fine but I'm stuck on the ListBox control. My approach to this has been
to render the readonly ListBox as a fixed-height and width <UL> containing
<LI>s with the selected list items displayed with the highlight color. But
here's the issue: how do I determine the height and width of the <UL> for
rendering? I could rely on the control user to explicitly set the height and
width properties of the Readwrite/ReadOnly ListBox descendent but that
solution is far from satisfactory.
Any ideas on how I can get around this problem?
TIA
Johno