Simon Hibbard's Web Apps Blog

Using RadioButton Controls inside a Repeater (groupname problem)


Radio Buttons have the attribute ‘groupname’. The point of this attribute to to ensure any radio buttons in the same group are mutely exclusive (only one in the group can be selected).

This is the case when using them normally but as soon as you put them into a repeater control (e.g. datalist) .Net scrambles the group name value and it no longer works as a group. All can be selected.

This can be fixed with a bit of Javascript and some code during the list databinding event (provided by Microsoft).

See this link -> http://www.codeguru.com/csharp/csharp/cs_controls/custom/article.php/c12371/

Works for .Net 1.0 and 2.0.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s