Hi,
I have a webdatagrid with a checkbox column inside an ItemTemplate and a submit button as below
<Columns>
<ig:TemplateDataField Key=" boolColumn">
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" AutoPostback="true" onCheckedChanged="CheckBox1_CheckedChanged"
Checked='<%# DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "boolColumn")%>'>
</asp:CheckBox>
</ItemTemplate>
<Header Text="boolColumn" />
</ig:TemplateDataField>
</Columns>
<asp:button ID="btnSave" text="Save" runat="server" onClick="SaveGrid"/>
So now,I have a bunch of records with a checkbox column and a postback happens when I check/uncheck a checkbox, as intended. But the problem here is, if I have my checkbox selected on 2 rows, the postback happens for 2 times and if 3 checkboxes on 3 rows are selected, then the postback happens 3 times. On top of it, when I click my save button, the checkbox's "CheckChanged" event gets fired first and then the save event gets fired.
Really wired. I dont understand why it happens, do you know why it is and have any solution for this?.
Hello Nagaraj,
Thank you for your patience.
After examining the issue, our engineers have determined that this issue is due to the fact that after changing the checkbox state in this scenario, the datasource from which the checkbox value is coming is not updated. To avoid this issue I would suggest either updating the datasource and rebinding the grid on each checkbox value change, or avoiding the use of the DataBinder in this case.
Another alternative, given that the checkboxes are being bound to the same datasource as the grid, would be to use BoundCheckboxFields:
http://help.infragistics.com/NetAdvantage/ASPNET/2013.1/CLR4.0/?page=WebDataGrid_Columns.html
Please do not hesitate to contact me if you have any questions.
Thank you for bringing this issue to our attention. Using the databinder appears to have a relation to the issue in this case. After investigating the scenario, I have asked our engineers to look into this matter further. To ensure that it will receive attention, I have logged this behavior in our internal tracking system with a Development ID of 157288. The next step will be for a developer to review my investigation and confirm my findings or to offer a fix, or other resolution.
You can also continue to send updates to this case at any time.
You can view the status of the development issue connected to this case by selecting the "Development Issues" tab when viewing this case on the web site.
Please let me know if you need more information.