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

[Solved] Set datafield of grid column

1 Answer 195 Views
Grid
This is a migrated thread and some comments may be shown as answers.
aks
Top achievements
Rank 1
aks asked on 09 Apr 2009, 11:08 PM
I have an existing grid.  I would like to change the datafield of a specific column in my C# code.  How can I do this??

I want to do something like below.  I can't set the datafield. 

Please help, thanks!

 

 

for (int i = 0; i <= WorklistGrid.Columns.Count - 1; i++)

 

{

 

 

 

if (WorklistGrid.Columns[i].HeaderText == "Initiated")

 

{

 

WorklistGrid.Columns[i].HeaderText = "J Start Date";
WorklistGrid.Columns[i].Datafield = "JSTARTDATE";
 

 

}
}

1 Answer, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 13 Apr 2009, 11:38 AM
Hello aks,

I am sending you a small sample demonstrating how to change the data field for a grid bound column. By analogy you can do that of other type of columns.

I hope this sample will be helpful to your.

Best Regards,
Tsvetoslav
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
aks
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Share this question
or