modify display of RadioButtonList items

M

Mark

Hi,
I currently use a radiobuttonlist to display a selection of choices a user
needs to make. However, the requirement has changed somewhat in that now I
need to create the following situation: with some of the items displayed, if
user selects it, other 'deeper' items display (more option list items,
intitially set to invisible), but with these 'new' items indented to indicate
that they sit 'under' the initially selected item. For example, if the
original list contained fruit such as Apples, Pears, Grapes, and the user
selects Apples, then underneath that selection (and before the Pears
selection) two new selections appear -- Macintosh and Granny Smith -- and
indented slightly from the original list items.

Is this kind of scenario even possible with the radiobuttonlist control, and
if so, could someone point me in the right direction as to how to accomplish
this. TIA.
 
S

Steven Cheng[MSFT]

Hi Denmast,

Welcome to ASPNET newsgroup.
As for the problem you mentioned, here are some of my suggestions:

1. Since the RadioButtonList control is well encapsulated and doesn't
provide any buildin means for injecting and customzation, I don't think
it's appropriate to use radioButtionList for your scenario(inject some sub
level check items between each top level items).
If you do need such structure output, I suggest you considering creating a
custom control which will output the RadioButtion collection depending on
the datasource and each RadioButton is put in a TableCell together with
another
Container control within it. The container control( maybe a panel or place
holder ) will contains those such level check items of each toplevel radio
buttion. And in the RadioButton's click event, we can show the subitems.

2. Also, do you think it possible that we don't inject the sub level items
between the top level radio buttions? We can separate the top level radio
buttions and the sub level items. Forexample, we use a radioButtonList to
display the toplevel options and then, when a certain item is selected , we
display the subitems dynamically in another table or panel and when it's
unselected, we hidden those sub items and display the new subitems
according to the new selected one.

How do you think of this? If there're anything unclear or any other ideas,
please feel free to post here. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
S

Steven Cheng[MSFT]

You're welcome Denmast,

If anything else we can help later, please also feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top