Datagrid related query

  • Thread starter Thread starter sachin.aks
  • Start date Start date
S

sachin.aks

Dear Members,
I am using a datagrid in which i have five columns.
First one is of Roll_no which is bounded column and rest four are
template columns name Present, Absent, UnfairMean and Lost
respectively. I am using radio button in all four template columns.

I want that user can select only one radio button
for each roll no in each row.
what could be the possible code for this in asp.net
 
Hi,

I suppose - using ItemCreated OR ItemDataBound event, you will have to
set the GroupName property of the radio buttons

Note: The GroupName property should be unique for all the rows

Does this give you some idea to implement it?

Kalpesh
 
RadioButtons

Hi..!

You can go for the following code.

<asp:RadioButton id="<control id>" Text="<Control Text>" Groupname="<put a groupname like g1, g2, etc.>" runat="server"/>

Note: Groupname is the most important part while inserting RadioButton, because when you assign same groupname for a bunch of RadioButtons, it will allow you to select only one RadioButton from that group.

for ex.
<asp:RadioButton id="r1" GroupName="gender" Text="Male" runat="server"/>
<asp:RadioButton id="r2" GroupName="gender" Text="Female" runat="server"/>

Try this...!

All the best...!

Kalpesh said:
Hi,

I suppose - using ItemCreated OR ItemDataBound event, you will have to
set the GroupName property of the radio buttons

Note: The GroupName property should be unique for all the rows

Does this give you some idea to implement it?

Kalpesh
 
RadioButtons

Hi..!

You can go for the following code.


<asp:RadioButton id="<control id>" Text="<Control Text>" Groupname="<put a groupname like g1, g2, etc.>" runat="server"/>

Note: Groupname is the most important part while inserting RadioButton, because when you assign same groupname for a bunch of RadioButtons, it will allow you to select only one RadioButton from that group.

for ex.
<asp:RadioButton id="r1" GroupName="gender" Text="Male" runat="server"/>
<asp:RadioButton id="r2" GroupName="gender" Text="Female" runat="server"/>

Try this...!

All the best...!

Dear Members,
I am using a datagrid in which i have five columns.
First one is of Roll_no which is bounded column and rest four are
template columns name Present, Absent, UnfairMean and Lost
respectively. I am using radio button in all four template columns.

I want that user can select only one radio button
for each roll no in each row.
what could be the possible code for this in asp.net
 

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

Back
Top