CFCA Newbie: RadioButtonList - render horizontally?

Feb 11, 2008 at 4:25 AM
Edited Feb 11, 2008 at 4:31 AM
I am new to the CSS Friendly Control Adapters and just installed the new ChangeSet 9278 which I believe was just released today. Main reason - I want more control over rendered HTML especially on the RadioButtonList which this ChangeSet handles.

What I am doing is creating a Survey app. I am going to have it setup like this:

Str Agree Agree NA Disagree Str Disagree
1. This is my question? O O O O O
2. This is my question? O O O O O

How can I render my RBL horizontally without having to go through a lot of hassle developing CSS classes? Also, I want to take every other Radio button cell or LI and display it in a grey background. How do I do this?

Per my example above, that will create a vertical colored grey bar every other column that will have labels on top (I tried to provide a visual, but the Wiki Markup is not taking the blank spaces). Please help.

Thanks!

Feb 13, 2008 at 4:19 PM
Any responses here? I can't be asking the impossible?!

Thanks
Coordinator
Feb 15, 2008 at 3:03 AM
The CSS adapters render the RadioButtonList as an unordered list (UL). So, you'd need to do stuff like this:

li.AspNet-RadioButtonList-Item
{
white-space:nowrap; /* forces the radio button and text to be on the same line */
float:left;
width:120px;
}

That'll get you horizontal. To get the shading, it's going to be more complex. Considering you want your layout to be more table-oriented, I'd suggest formatting an HTML table and using RadioButton controls instead.