I have a datagrid that is populated through user input, and in that grid I have a checkbox that should remove the row from the datagrid if checked. I have set the EnableViewState to true and false with no results. It appears that if the checkbox is clicked, the event does not fire. Debugging never gets to the event. Can anyone point me? Here's the markup:
<asp:TemplateColumn HeaderText="Remove">
<ItemTemplate>
<asp:checkbox ID="chkSelection" runat="server" AutoPostBack="True" Checked="false" OnCheckChanged="EPACheck_Clicked"/>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" Width="50px" />
And here's the code behind for the event:
Protected Sub EPACheck_Clicked(ByVal sender As Object, ByVal e As EventArgs)
Dim ckbx As CheckBox = CType(sender, CheckBox)
Dim dgItem As DataGridItem = CType(ckbx.NamingContainer, DataGridItem)
Dim rcDelete As String = dgItem.ItemIndex
CType(Session("mytable"), DataTable).Rows.RemoveAt(Convert.ToInt32(rcDelete))
BindgrdEPA()
End Sub
Aucun commentaire:
Enregistrer un commentaire