Add RadioButton Columns in the Gridview ItemTemplate
<ItemTemplate><asp:CheckBox ID="ChkMustMeet" runat="server" AutoPostBack="True" />
</ItemTemplate>
CodeBehind:
protected void Page_Load(object sender, EventArgs e)
{
if
(!IsPostBack)
{
BindGrid();
}
else
{
GetCount();
}
}
private int GetCount()
{
int count = 0;
GridViewRow row = null;
for (int i = 0; i < GridView1.Rows.Count; i++)
{
row =GridView1.Rows[i];
bool isChecked = ((RadioButton)row.FindControl("ChkMustMeet")).Checked;
if (isChecked)
{
count++;
}
}
return count;
}
Change the above accordingly if you need each time check and uncheck use select changed event.
Hope this helps...