mardi 1 novembre 2022

Checkbox OnCheckChanged Event is not fired within DevExpress ASPxGridView HeaderTemplate

I've been trying to fire the Checkbox OnCheckedChanged event of an ASPxCheckBox implemented in HeaderTemplate of code. But it isn't working. Please find below code.

<dxwgv:GridViewDataTextColumn Caption="Select" FieldName="Included">
                        <Settings AllowAutoFilter="False" />
                        <HeaderTemplate>
                            <dxe:ASPxCheckBox ID="chkSelectAll" runat="server" AutoPostBack="True" AllowGrayed="false" OnCheckedChanged ="SelectAllOperation">
                            </dxe:ASPxCheckBox>
                        </HeaderTemplate>
                        <DataItemTemplate>
                            <dxe:ASPxCheckBox ID="chkSelect" runat="server" Value='<%# Eval("CompositeKey") %>'
                                Checked='<%# Eval("AccessCode").ToString() == "A" %>' OnInit="chkSelect_Init">
                            </dxe:ASPxCheckBox>
                        </DataItemTemplate>
                        <CellStyle HorizontalAlign="Center" />
                    </dxwgv:GridViewDataTextColumn>

Following is the function I expect to reach after checking the checkbox in HeaderTemplate.


public void SelectAllOperation(object sender, EventArgs e)
        {
        }
      

However, It is working fine when implemented in DataItemTemplate. When I select the checkbox in HeaderTemplate, OnCheckedChanged event is not fired and I'm unable to reach the required function.




Aucun commentaire:

Enregistrer un commentaire