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
275
CheckBox on UltraWebGrid Column Header.
posted

Hi,

i am using infragistics "NetAdvantage for .NET 2009 Vol 1" license version.

Requirment:

i am working on UltraWebGrid and the grid have multiple column. the first column of UltraWebGrid is CheckBox.

 i want a CheckBox on first UltraWebGrid column header so that i can Check / UnCheck all the row at a single Click.

please tell me that this feature is available in "NetAdvantage for .NET 2009 Vol 1" or not. if it is available then how will achieve this functionality.

 

Thanks & Regard's

Sachin Kumar

 

 

Parents
No Data
Reply
  • 5
    posted

     

    <

     

    script type="text/javascript">

     

    function CheckHeaderCheckBoxItem(HeaderChkObj, ItemCheckBoxKey) {

     

    var hdnTCGridID = document.getElementById("hdnuwgItem").value;

    GridName = hdnTCGridID;

    CheckAllCheckBoxInCell(HeaderChkObj.checked, GridName, ItemCheckBoxKey);

    }

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    //this function will check all the check box in the row. of that column

     

     

    function

    CheckAllCheckBoxInCell(_CheckStatus, _GridName, _KeyValue) {

     

     

    var

    _InstanceValue = 0;

     

     

    //get the object of the grid

     

     

    var

    _grid = igtbl_getGridById(_GridName);

     

     

    //getting the grid bands

     

     

    var

    oBands = _grid.Bands;

     

     

    var

    oBand = oBands[0];

     

     

    //getting the index of the columns in the row by passing the key

     

     

    var

    _colIndex = oBand.getColumnFromKey(_KeyValue).Index;

     

     

    //iteratin tru the row and getting the cell with the key

     

     

    for

    (_Index = 0; _Index < _grid.Rows.length; _Index++) {

     

     

    //getting the cell object

     

     

    var

    _CellObj = GetCellByKey(_GridName, _grid.Rows.getRow(_Index).Id, _KeyValue);

     

     

    //getting the checkbox with the object or tag name.

     

     

    var _CheckBoxElement = _CellObj.Element.getElementsByTagName("input"

    )[0];

     

     

    //changing the status

    _CheckBoxElement.checked = _CheckStatus;

    }

    }

    </

     

    script>

     

    <igtbl:UltraWebGrid ID="uwgItem" runat="server" Height="200px" Width="100%" StyleSetName="QUltraWebGridForSearchPage" >

     

    <Bands>

     

    <igtbl:UltraGridBand>

     

    <Columns>

     

    <igtbl:TemplatedColumn Width="5%" Key="KeyItemCheckBox">

     

    <HeaderTemplate>

     

    <asp:CheckBox ID="chkItemHeader" runat="server" onclick="CheckHeaderCheckBoxItem(this,'KeyItemCheckBox')" />

     

    </HeaderTemplate>

     

    <CellTemplate>

     

    <asp:CheckBox ID="chkItemSelect" runat="server" />

     

    </CellTemplate>

     

    </igtbl:TemplatedColumn>

     

    <igtbl:UltraGridColumn BaseColumnName="ItemCode" IsBound="True" Key="KeyItemCode"

     

    AllowUpdate="No" Width="20%">

     

    <Header Caption="<%$ Resources:CommonWebResources,Ugc_Hdrcpn_ItemCode%>">

     

    <RowLayoutColumnInfo OriginX="2" />

     

    </Header>

     

    <Footer>

     

    <RowLayoutColumnInfo OriginX="2" />

     

    </Footer>

     

    </igtbl:UltraGridColumn>

    ------------

    --------

    </

     

    igtbl:UltraWebGrid>

    Govind Kumar

    QS

Children
No Data