Readonly listbox

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top