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

manually added columns?

1 Answer 66 Views
GridView
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 02 Dec 2007, 08:39 AM
Hi,

I want to add some columns manually, but it is not appear always.
Some code like follows:

radGvAllocateList.MasterGridViewTemplate.AutoGenerateColumns = false; ; 
 
GridViewTextBoxColumn colText = new GridViewTextBoxColumn(); 
colText.UniqueName = "colStaff"
colText.HeaderText = FormText.Collector; 
colText.Width = 100; 
radGvAllocateList.MasterGridViewTemplate.Columns.Add(colText); 
 
GridViewTextBoxColumn colRate = new GridViewTextBoxColumn(); 
colRate.UniqueName = "colRate"
colRate.DataType = typeof(decimal); 
colRate.HeaderText = FormText.Collector; 
colRate.Width = 60; 
radGvAllocateList.MasterGridViewTemplate.Columns.Add(colRate); 

How can I do it? Please help me.

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 04 Dec 2007, 02:10 PM
Hi James,

Everything seems to be ok with your code snippet. May be the only thing that we do not know is how you bind your grid. Naturally, you have to set a DataSource to your RadGridView, and our grid support binding to different data sources (as demonstrated in our Quick Start Framework, section RadGridView >> DataBinding).

If the problem still persist, please open a support ticket and send us a sample project to investigate it further.


All the best,
Nikolay
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
James
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or