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

[Solved] Set ColumnEditorID from code

1 Answer 122 Views
Grid
This is a migrated thread and some comments may be shown as answers.
wnl
Top achievements
Rank 1
wnl asked on 03 Feb 2010, 01:52 PM
Hi,
how to set ColumnEditorID for columns in radgrid from c# code? Which event?
Thanks.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 04 Feb 2010, 07:49 AM
Hi,

To set the ColumnEditorID  for declarative columns from code use the code snippet below:

C#
protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e) 
        { 
            if (e.Column is GridBoundColumn) 
            { 
                GridBoundColumn col = (GridBoundColumn)e.Column; 
                col.ColumnEditorID = ""
            } 
 
        } 
 


To set the ColumnEditorID  for autogenerated columns from code use the code snippet below:

C#
  protected void RadGrid1_PreRender(object sender, EventArgs e) 
        { 
            foreach (GridBoundColumn col in RadGrid1.MasterTableView.RenderColumns) 
            { 
                col.ColumnEditorID = ""
            } 
 
        } 


Thanks,
Princy
Tags
Grid
Asked by
wnl
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or