Radiobuttonlist and cssclass

N

Nick Hartley

I am in the process of updating old asp projects into asp.net.

We used to have radiobuttons which had an attached css class as
follows:

<label for="q2a1">High<input id = "q2a1" class = "radio" type="radio"
name="q2a" value="1"></label>

with the corresponding css class:

..radio {height:40px;width:40px;};

This made the radio button bigger - handy because the applications we
make tend to be used by older / partially sighted people.


I am now trying to recreate this effect using radiobuttonlist in
asp.net. If I attach the same css class to the new radiobuttonlist, it
has a different effect - it makes the label for each of the items 40px
by 40px and keeps the radio button the same size (which has the effect
of making everything less easy to view).


I can't change the cssclass of the individual items - the property is
read only.

Anyone any ideas?

Much appreciated,

Nick Hartley
 
J

John Saunders

Nick Hartley said:
I am in the process of updating old asp projects into asp.net.

We used to have radiobuttons which had an attached css class as
follows:

<label for="q2a1">High<input id = "q2a1" class = "radio" type="radio"
name="q2a" value="1"></label>

with the corresponding css class:

.radio {height:40px;width:40px;};

This made the radio button bigger - handy because the applications we
make tend to be used by older / partially sighted people.


I am now trying to recreate this effect using radiobuttonlist in
asp.net. If I attach the same css class to the new radiobuttonlist, it
has a different effect - it makes the label for each of the items 40px
by 40px and keeps the radio button the same size (which has the effect
of making everything less easy to view).


I can't change the cssclass of the individual items - the property is
read only.

You may be able to get away with putting the class attribute on the
ListItems. If you're databinding, you'll have to do this after the control
is databound, perhaps in the pages PreRender event. I'm not sure whether
this will work for you - I have a Whidbey pre-Beta installed, and it doesn't
work there.

Otherwise, you would have to create your own RadioButtonList control in
order to do this. That shouldn't be _too_ difficult, as you can derive from
ListControl to get most of the features you need.
 
J

John Saunders

Nick Hartley said:
I am in the process of updating old asp projects into asp.net.

We used to have radiobuttons which had an attached css class as
follows:

<label for="q2a1">High<input id = "q2a1" class = "radio" type="radio"
name="q2a" value="1"></label>

with the corresponding css class:

.radio {height:40px;width:40px;};

This made the radio button bigger - handy because the applications we
make tend to be used by older / partially sighted people.


I am now trying to recreate this effect using radiobuttonlist in
asp.net. If I attach the same css class to the new radiobuttonlist, it
has a different effect - it makes the label for each of the items 40px
by 40px and keeps the radio button the same size (which has the effect
of making everything less easy to view).


I can't change the cssclass of the individual items - the property is
read only.

Anyone any ideas?

Oh, duh! You could use a RadioButton inside of a DataList.
 

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,789
Messages
2,569,634
Members
45,342
Latest member
Sicuro

Latest Threads

Top