Riddhi Valecha

Riddhi Valecha

  • 443
  • 3.3k
  • 411k

GridView - RadioButtonList

Oct 13 2016 5:19 AM
Hi all..
 
I have a gridview -
 
<asp:GridView ID="grdGetAsset" runat="server" AutoGenerateColumns="false" Width="100%"
OnRowDataBound="grdGetAsset_RowDataBound">
<Columns>
<asp:BoundField DataField="Name" HeaderText="Name" />
<asp:BoundField DataField="Dept" HeaderText="Department" />
<asp:BoundField DataField="TotalYearsInCompany" HeaderText="Duration" />
<asp:BoundField DataField="Brand" HeaderText="Brand" />
<asp:TemplateField HeaderText="Certified Status" HeaderStyle-Width="200px">
<ItemTemplate>
<asp:RadioButtonList ID="radiobtnlist" runat="server" RepeatDirection="Horizontal"
CssClass="radiobuttonlist">
<asp:ListItem Text="I Own" Value="OWN"></asp:ListItem>
<asp:ListItem Text="I Do Not Own" Value="DONOTOWN"></asp:ListItem>
</asp:RadioButtonList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle Width="60px" Height="50px" />
<RowStyle Width="200px" />
</asp:GridView>
 
-------------
 
Issue - On button click event - I need to check whether how many rows RadioButtonList is checked..
If none is checked, then an alert message should come - "No Rows Selected"
 
Please guide..

Answers (7)