Hi,
I am using radiobuttonlist and textbox in the gridview. I need to do operations on radiobuttonlist so that it should reflect on textbox . this is to be done after gridview_rowediting event fires i.e when we can see "update" and "cancel" buttons. I tried like this,
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e) { GridView1.EditIndex = e.NewEditIndex; GridViewRow editingRow = GridView1.Rows[e.NewEditIndex]; RadioButtonList rbl = RadioButtonList)editingRow.Cells[17].FindControl("rblist11");
rbl.Visible = true;
TextBox txtamt = (TextBox)editingRow.Cells[18].FindControl("TextBox3");
txtamt.Enabled = true; if (rbl.SelectedItem.Value.Contains("1")) { txtamt.Enabled = true; } else if (rbl.SelectedItem.Value == "2") { txtamt.Enabled = true; } else if (rbl.SelectedItem.Value == "0") { txtamt.Enabled = false; } }
here default selected value is "0" given in source.
My problem here is when I am changing the selecteditem, the corresponding action is not done.
if this action is not done in rowediting event, Please give me the appropriate solution.