This is a migrated thread and some comments may be shown as answers.

Rad GridCheckBoxColumn Enabling

1 Answer 470 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert Dennyson
Top achievements
Rank 2
Robert Dennyson asked on 23 Aug 2010, 02:42 PM
Hi,

I'm using rad gridcheckboxcolumn to display pivot table data. So I was trying to create checkbox columns programatically, because table column values will not be in consistant manner. I could display the data with gridcheckboxcolumn, but its not coming in edit mode. All the chechbox results coming in disabled mode. How can make it in enable mode by default(Without edit click).

Otherwise can I try GridTemplateColumn? If so what to give for xyzTemplateColumn.ItemTemplate=???
How to create the GridTemplateColumn to handle boolean pivoted data progarmatically?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 25 Aug 2010, 09:50 AM
Hello Robert,

I believe the better option is using GridTemplatecolumn with CheckBox inside.
Programmatic creation

Also the following code shows how to enable the CheckBox of GridCheckBoxColumn in normal mode.
C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
  {
      if (e.Item is GridDataItem)
      {
          GridDataItem dataItem = (GridDataItem)e.Item;
          CheckBox chkBox = (CheckBox)dataItem["ColumnUniqueName"].Controls[0];
          chkBox.Enabled = true; // enable CheckBox
      }
 }

Thanks,
Princy.
Tags
Grid
Asked by
Robert Dennyson
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Share this question
or