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
20
Checkbox in web hierarchical data grid
posted

I was using ultrawebgrid earlier, now its not supporting for IE11, so changing it to webhierarchicaldatagrid .My issue is,  i want to bind checkbox for a column from codebehind.
W.r.t ultrawebgrid

uwgDisplay.DisplayLayout.Bands[0].Columns.FromKey("UsedInContainer").Type = ColumnType.CheckBox;

but how to do it using webhierarchicaldatagrid.

Parents
  • 1440
    posted

    Hello Ali,

    thank you for contacting us.

    Since the WebDataGrid has different architecture than the UltraWebGrid, the type of the column is not set via a specific property. Instead it's determined by the actual column type that you've declared. You can refer to the different column types available and how to add them here:

    http://help.infragistics.com/Doc/ASPNET/2011.1/CLR4.0/page=WebDataGrid_Columns.html

    To create a column that contains a checkbox you would need to use a BoundCheckBoxField column type.

    You can declare it in your aspx page for example:


    And you can dynamically set the DataKeyField it will use to get its data from in the code behind, for example:

      ((BoundCheckBoxField)this.whdg.Columns["checkbox"]).DataFieldName = "CheckBox";
      ((BoundCheckBoxField)this.whdg.Bands[0].Columns["checkbox"]).DataFieldName = "CheckBox";

    WHDGBoundCheckBox.rar
Reply Children
No Data