Hi,
you can use RadioButtonList in the ItemTemplate of the gridview and in RowDataBound event of the gridview, you can bind the items of the list.
<itemtemplate>
<asp:RadioButtonList id="rbList" runat="server" AutoPostBack="false"></asp:RadioButtonList>
</itemtemplate>
protected void gridview1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
RadioButtonList list = (RadioButtonList)e.Row.FindControl("rbList");
list.DataSource = objDT;
list.DataBind();
}
}
protected void lbtnsubmit_Click(object sender, EventArgs e)
{
for (int i = 0; i < GridView1.Rows.Count; i++)
{
RadioButtonList rblist = (GridView1.Rows[i].FindControl("rbList")) as RadioButtonList;
if (rblist.SelectedItem != null)
{
asnw.Text = rbList.SelectedItem.Text;
}
}
}
hope it helps