Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Readonly listbox

Thread Tools

Readonly listbox

Posts: n/a
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?


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Listbox item added with client scripts not submitting with ASP:Listbox Simon Prince ASP .Net 2 10-19-2004 04:11 PM
ASP.NET Readonly panel function with readonly checkbox, readonly radiobutton Jonathan Hyatt ASP .Net Web Controls 1 06-08-2004 07:42 PM
How do I move all items in a listbox to another listbox kent ASP .Net 1 05-03-2004 12:17 AM
click listbox and refresh another listbox DC Gringo ASP .Net 0 04-06-2004 02:13 AM
Re: now desparate! - 1st listbox contents disappears when 2nd listbox appears? blenderdude ASP .Net 0 08-03-2003 10:18 PM