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

Add column programatically

1 Answer 58 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Henrique Duarte
Top achievements
Rank 1
Veteran
Henrique Duarte asked on 24 Jun 2009, 02:52 PM
Hello,

How can I add a column and set DataMemberPath and DataFormatString properties programatically?

Regards,

Henrique

1 Answer, 1 is accepted

Sort by
0
Accepted
Milan
Telerik team
answered on 25 Jun 2009, 06:33 AM
Hello Henrique Duarte,

There is no problem to define columns in code. Here is a sample snippet:

GridViewDataColumn column = new GridViewDataColumn();  
column.DataMemberPath = "Sender";  
column.DataFormatString = "XXX {0}";  
column.HeaderText = "Column";  
 
this.RadGridView1.Columns.Add(column); 


Kind regards,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Henrique Duarte
Top achievements
Rank 1
Veteran
Answers by
Milan
Telerik team
Share this question
or