Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • Hi, how I can add checkbox in column header in aspxgridview,for example in this grid:
                                    1.I want to add checkbox in the header of columns Add,Open, delete, print
                                    2. then when I check or uncheck this checkbox I want to check all checkboxes in the same column, for example when i check checkbox in "Add column header", all checkboex in add column must be checked.
                                     
                                    <dx:ASPxGridView ID="grdPermissions" runat="server" AutoGenerateColumns="False"
                                                        CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua"
                                                        DataSourceID="sdScreens" KeyFieldName="ScreenID" Width="100%">
                                                        <styles cssfilepath="~/App_Themes/Aqua/{0}/styles.css" csspostfix="Aqua">
                                                            <Header Font-Names="Tahoma" Font-Size="Small" HorizontalAlign="Center">
                                                            </Header>
                                                            <Cell Font-Names="Tahoma" Font-Size="Small">
                                                            </Cell>
                                                            <LoadingPanel ImageSpacing="8px">
                                                            </LoadingPanel>
                                                        </styles>
                                                        <SettingsLoadingPanel ImagePosition="Top" />
                                                        <SettingsPager Mode="ShowAllRecords">
                                                        </SettingsPager>
                                                        <imagesfiltercontrol>
                                                            <loadingpanel url="~/App_Themes/Aqua/Editors/Loading.gif">
                                                            </loadingpanel>
                                                        </imagesfiltercontrol>
                                                        <images spritecssfilepath="~/App_Themes/Aqua/{0}/sprite.css">
                                                            <loadingpanelonstatusbar url="~/App_Themes/Aqua/GridView/gvLoadingOnStatusBar.gif">
                                                            </loadingpanelonstatusbar>
                                                            <loadingpanel url="~/App_Themes/Aqua/GridView/Loading.gif">
                                                            </loadingpanel>
                                                        </images>
                                                        <Columns>
                                                            <dx:GridViewDataTextColumn FieldName="ScreenID" ReadOnly="True" Visible="False"
                                                                VisibleIndex="0">
                                                                <EditFormSettings Visible="False" />
                                                            </dx:GridViewDataTextColumn>
                                                            <dx:GridViewDataTextColumn Caption="Role" FieldName="ScreenName"
                                                                VisibleIndex="1">
                                                                <Settings ShowFilterRowMenu="True" ShowInFilterControl="True"
                                                                    AutoFilterCondition="Contains" />
                                                            </dx:GridViewDataTextColumn>
                                                            <dx:GridViewDataCheckColumn Caption="Open"
                                                                VisibleIndex="2">
                                                                <Settings ShowInFilterControl="False" />
                                                            <DataItemTemplate>
                                                                <dx:ASPxCheckBox ID="chkOpen" runat="server" >
                                                                </dx:ASPxCheckBox>
                                                            </DataItemTemplate>
                                                            </dx:GridViewDataCheckColumn>
                                                            <dx:GridViewDataCheckColumn Caption="Add" VisibleIndex="3">
                                                                <Settings ShowInFilterControl="False" />
                                                            <DataItemTemplate>
                                                                <dx:ASPxCheckBox ID="chkAdd" runat="server" >
                                                                </dx:ASPxCheckBox>
                                                            </DataItemTemplate>
                                                            </dx:GridViewDataCheckColumn>
                                                            <dx:GridViewDataCheckColumn Caption="Edit" VisibleIndex="3">
                                                                <Settings ShowInFilterControl="False" />
                                                            <DataItemTemplate>
                                                                <dx:ASPxCheckBox ID="chkEdit" runat="server" >
                                                                </dx:ASPxCheckBox>
                                                            </DataItemTemplate>
                                                            </dx:GridViewDataCheckColumn>
                                                            <dx:GridViewDataCheckColumn Caption="Delete" VisibleIndex="4">
                                                                <Settings ShowInFilterControl="False" />
                                                            <DataItemTemplate>
                                                                <dx:ASPxCheckBox ID="chkDel" runat="server" >
                                                                </dx:ASPxCheckBox>
                                                            </DataItemTemplate>
                                                            </dx:GridViewDataCheckColumn>
                                                            <dx:GridViewDataCheckColumn Caption="Print" VisibleIndex="5">
                                                                <Settings ShowInFilterControl="False" />
                                                            <DataItemTemplate>
                                                                <dx:ASPxCheckBox ID="chkPrint" runat="server" >
                                                                </dx:ASPxCheckBox>
                                                            </DataItemTemplate>
                                                            </dx:GridViewDataCheckColumn>
                                                            <dx:GridViewDataTextColumn VisibleIndex="6" Width="1px">
                                                            </dx:GridViewDataTextColumn>
                                                        </Columns>
                                                        <Settings ShowFilterRow="True" />
                                                        <styleseditors>
                                                            <calendarheader spacing="1px">
                                                            </calendarheader>
                                                            <progressbar height="25px">
                                                            </progressbar>
                                                        </styleseditors>
                                                        <imageseditors>
                                                            <dropdowneditdropdown>
                                                                <SpriteProperties HottrackedCssClass="dxEditors_edtDropDownHover_Aqua"
                                                                    PressedCssClass="dxEditors_edtDropDownPressed_Aqua" />
                                                            </dropdowneditdropdown>
                                                            <spineditincrement>
                                                                <SpriteProperties HottrackedCssClass="dxEditors_edtSpinEditIncrementImageHover_Aqua"
                                                                    PressedCssClass="dxEditors_edtSpinEditIncrementImagePressed_Aqua" />
                                                            </spineditincrement>
                                                            <spineditdecrement>
                                                                <SpriteProperties HottrackedCssClass="dxEditors_edtSpinEditDecrementImageHover_Aqua"
                                                                    PressedCssClass="dxEditors_edtSpinEditDecrementImagePressed_Aqua" />
                                                            </spineditdecrement>
                                                            <spineditlargeincrement>
                                                                <SpriteProperties HottrackedCssClass="dxEditors_edtSpinEditLargeIncImageHover_Aqua"
                                                                    PressedCssClass="dxEditors_edtSpinEditLargeIncImagePressed_Aqua" />
                                                            </spineditlargeincrement>
                                                            <spineditlargedecrement>
                                                                <SpriteProperties HottrackedCssClass="dxEditors_edtSpinEditLargeDecImageHover_Aqua"
                                                                    PressedCssClass="dxEditors_edtSpinEditLargeDecImagePressed_Aqua" />
                                                            </spineditlargedecrement>
                                                        </imageseditors>
                                                    </dx:ASPxGridView>

                                    please help me without redirect me to any other question as i have spent long time searching for such issue. send me code in VB.
                                    Thanks.

                                0

                                Hello Jehad,

                                Thank you for the detailed description of the issue. I suggest that you implement the following scenario:
                                1) Customize the HeaderTemplate and DataItemTemplate of the required ASPxGridView's column;
                                2) Put the ASPxCheckBox control onto the HeaderTemplate;
                                3) Handle the ASPxCheckBox's Init event and customize the ASPxClientCheckBox's CheckedChanged event via the ASPxCheckBox.ClientSideEvents.CheckedChanged property;
                                4) Handle the ASPxClientCheckBox's CheckedChanged event and perform the ASPxGridView's callback via the ASPxClientGridView's PerformCallback method (pass the checkbox's state as a parameter);
                                5) Handle the ASPxGridView's CustomCallback event and iterate through ASPxGridView's DataRows;
                                6) Change the ASPxCheckBox's state (inside the DataItemTemplate of the required GridViewDataColumn) based on the passed parameter.

                                Please take a look at the ASPxGridView - How to implement SelectRows and SelectAllRowsOnPage CheckBox features Knowledge Base article for more information.

                                Thanks,
                                Mike
                                --------------------
                                Check if Search Engine is able to answer questions faster than I do!
                                --------------------

                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners