Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
445
Checkbox column's inside webdatgrid posts back to server for several times
posted

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?.