I have added a template field in a gridview. In that i have added a radio button. I have written a code which will get row Id of GridView of a row which is having a radiobutton on it checked. Through code i am getting even name of that radio button, but it is showing me that radio button is not checked, even when it is already checked. Here is the code.
Dim row As GridViewRow Dim rd As RadioButton Dim rowId As Integer = -1 For Each row In GridView1.Rows rd = CType(row.FindControl("radio1"), RadioButton) If rd.Checked = True Then rowId = row.RowIndex Exit For End If Next
Even when a radio button is checked the code never enters the if block.
Pls help me urgently. Deadline appraoches soon ! :)