I have a gridview with checkbox on each row
on search i change the datasource select command then bind the gridview according to the new select statement
after that the checkbox value return false even if it is checked
and the delete row returning error for enableEventValidation i set it to false to check if the problem solved the error gone but no row deleting occurred
any suggestions?
code:
<asp:GridView ID="GV" runat="server" CssClass="gridviewGV" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="DomainsDS"
Font-Size="12px" PageSize="1000" Width="100%" EmptyDataText="No Records">
<Columns>
<ItemTemplate>
<asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="False" CommandName="Delete" ImageUrl="Img/Del.png" Text="Delete" />
<asp:checkbox" ID="CheckBox" runat="server" />
</ItemTemplate>
<HeaderStyle Width="50px" />
</asp:TemplateField>
</Columns>
</asp:GridView>
On btn click after the search change the datasouce select command and checked some of the checked boxes
For b As Integer = 0 To GV.Rows.Count - 1
Dim checkcx As checkbox=ctype(GV.Rows(b).findcontrol("CheckBox"),checkbox)
If checkcx.checked Then
End If
Next
but this check box is always false even if it is checked
this code is working 100% before the post back
but i need the post back to filter the data in gridview