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

Need GridTemplateColumns to be editable

1 Answer 42 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 12 Jul 2012, 11:04 AM
Hi all,

I have a radgrid in which, I have GridEditCommandcolumn, in that I need GridTemplateColumns to be editable and the GridBoundColumns to be non editable. How can I do this?

Thanks

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 12 Jul 2012, 11:13 AM
Hi Steve,

For preventing a column from editing, please set the ReadOnly property of the Columns to True.

ASPX:
<telerik:GridBoundColumn UniqueName="OrderID" HeaderText="OrderID" DataField="OrderID" ReadOnly="true"></telerik:GridBoundColumn>

OR

C#:
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
   foreach (GridColumn col in RadGrid1.MasterTableView.RenderColumns)
   {
     if (col.ColumnType == "GridBoundColumn")
     {
        GridBoundColumn boundCol = (GridBoundColumn)col;
        boundCol.ReadOnly = true;
     }
   }
}

Thanks,
Shinu.
Tags
Grid
Asked by
Steve
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or