Handle Multiple Click of Radio Button inside GridView

ASPX 
 
Here, I have not written the complete GridView Tag :
 --

<gridview> 

<Columns>  

<asp:TemplateField HeaderText="Select">

<ItemTemplate>

<asp:RadioButton ID="Rdbttn_Package" runat="server" AutoPostBack="true" Text='<%# DataBinder.Eval(Container,"DataItem.RP_SHORT_DESC") %>'

ToolTip='<%# DataBinder.Eval(Container,"DataItem.RP_AMOUNT") %>' OnCheckedChanged="Rdbttn_Package_CheckedChanged"  />

</ItemTemplate>

<HeaderStyle HorizontalAlign="Right" />

</asp:TemplateField>

 

</Columns> 

<GridView>

 
VB.NET 
  
Try
Dim rb As New RadioButton
Dim rbNewSelect As New RadioButton
Dim strOldSelect As String
strOldSelect = ""
Lbl_Error.Text = String.Empty
rbNewSelect = CType(sender, RadioButton)
For Each gvRow As GridViewRow In gv_RenewalSchemePackage.Rows
rb = CType(gvRow.FindControl("Rdbttn_Package"), RadioButton)
If (rb.Checked = True And rb.UniqueID <> rbNewSelect.UniqueID) Then
strOldSelect = rb.UniqueID
End If
rb.Checked = False
Next
rb.Dispose()
rbNewSelect.Checked = True
''Additional Code paste here  
Catch ex As Exception
         Lbl_Error.Text = "Error :" & ex.Message
Finally
End Try
Ebook Download
View all
Learn
View all