I'm using visual studio C#
I have gridView and I checked enable selection
I have radioButtonList with two values
when the page load I want the cloumn with the selection to be hidden, but when the user choose one of the radioButton the selection column will be visbale
Here is what I did, but I don't know why it's not working
protected void Page_Load(object sender, EventArgs e)
{
GridView1.Columns[8].Visible = false;
}
protected void RadioButtonList1_SelectedIndexChanged1(object sender, EventArgs e)
{
GridView1.Columns[8].Visible = true;
}
I also tried this, but also it's not working
protected void Page_Load(object sender, EventArgs e)
{
GridView1.Columns[8].Visible = false;
if (RadioButtonList1.Items[0].Selected == true || RadioButtonList1.Items[1].Selected == true)
{
GridView1.Columns[8].Visible = true;
}
}