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
105
UltraWinGrid select all checkbox in column header
posted

Hi,

Can someone tell me how to provide a Select All checkbox column in UltraWinGrid.

Thanks in advance.

Cheers

Rajesh

Parents
No Data
Reply
  • 10
    posted

    add  <ClientSideEvents ColumnHeaderClickHandler="UltraWebGrid1_ColumnHeaderClickHandler" /> to </DisplayLayout>

    add an keyid for the column,

     <igtbl:UltraGridColumn HeaderText="Check" Width="50px" AllowUpdate="Yes" Type="CheckBox" Key="chk1" SortIndicator="Disabled"
                                >
                                <CellStyle HorizontalAlign="Center">
                                </CellStyle>
                                <Footer>
                                </Footer>
                                <Header  Caption="Check">
                                </Header>
                            </igtbl:UltraGridColumn>

    hook up the same with javascript

      function UltraWebGrid1_ColumnHeaderClickHandler(gridName, columnId, button) {

                //Add code to handle your event here.

                var myCol = igtbl_getColumnById(columnId);
              

                if (myCol.Key == "chk1") {

                    var myGrid = igtbl_getGridById(gridName);

                    for (i = 0; i < myGrid.Rows.length; i++) {
                       
                        if (myGrid.Rows.getRow(i).getCellFromKey("chk1").getValue() == "1") {
                            myGrid.Rows.getRow(i).getCellFromKey("chk1").setValue(0);
                        }
                        else {
                            myGrid.Rows.getRow(i).getCellFromKey("chk1").setValue(1);
                        }
                    }

                   
                }

        }

Children
No Data