I have asp gridview which is bind with a datatable. Only one template column that is checkbox is bind with source datatable column (sel).
Here is markup example:
<asp:GridView ID="testGrid"
CssClass="ObjSelection"
AutoGenerateColumns="false"
OnRowDataBound="testGrid_RowDataBound"
runat="server">
<Columns>
<asp:TemplateField HeaderText=" ">
<HeaderTemplate>
<asp:CheckBox ID="chkAll" runat="server" Enabled="true" AutoPostBack="true" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox AutoPostBack="true" ID="chkRow" runat="server" Checked='<%# DataBinder.Eval(Container.DataItem, "sel")%>' OnCheckedChanged="ChkRow_OnCheckChange" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
As you see, I am not using RowCommand to delete a row. I have a toolbar in a separate div, which shows delete button.
Can you guide how could I delete a row both from DataSource and GridView on a button click which exists in another div?