radiobuttonlist in gridview

Posted by Mahesh_Chs under ASP.NET on 11/26/2012 | Points: 10 | Views : 3580 | Status : [Member] | Replies : 1
hi,


this is my code
<asp:BoundField DataField="admno" HeaderText="admno" ReadOnly="True" SortExpression="admno">
<ItemStyle HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Attendance">
<ItemTemplate>
<asp:RadioButtonList ID="rbd_join" AutoPostBack="true" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Text="Present" Value="1"></asp:ListItem>
<asp:ListItem Text="Absant" Value="0"></asp:ListItem>
</asp:RadioButtonList>
</ItemTemplate>
</asp:TemplateField>

in the buttonclick event i want to insert the values based on the selection of either absant or present....


Thanks in advance




Responses

Posted by: Krv on: 11/26/2012 [Member] Starter | Points: 25

Up
0
Down
You can loop thr the grid, and you findcontrol method to find the radiolist and get its value
Eg:
Foreach(Gridviewrow gv in Grd.Rows)
{
RadioButtonList rbl = (RadioButtonList)gv.FindControls("rbd_join")
}


----
Mark it answer if it helps.

Thanks,
R.Vasanth
MCTS(SQL Server & BI)
http://bigdatatech.blogspot.com

Mahesh_Chs, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response