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

radgridview

5 Answers 176 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Najoua
Top achievements
Rank 1
Najoua asked on 07 Jun 2007, 10:28 AM
hi,i used the trial version of radgridview but I've a problem with defining columns and their names.I've defined the head text but nothing is shown in the control.so I want to use it like the simple gridview.

5 Answers, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 07 Jun 2007, 04:05 PM
Hi Mlle,

When you manually add columns to RadGridView you must set the DataField  property of any column to the related column name in the data source object. Alternatively, you can set the DataSource property and RadGridView automatically will be populated.

I hope this helps.

All the best,
Julian Benkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Najoua
Top achievements
Rank 1
answered on 08 Jun 2007, 08:01 AM
Thanks!
0
fgalarraga
Top achievements
Rank 1
answered on 20 Jun 2007, 04:52 AM
Can you give more detail I am trying to set the column names so that they are not generated by the datasource. Can you please explain how to do this?

Thank you!
0
fgalarraga
Top achievements
Rank 1
answered on 20 Jun 2007, 04:52 AM
Can you give more detail I am trying to set the column names so that they are not generated by the datasource. Can you please explain how to do this?

Thank you!
0
Julian Benkov
Telerik team
answered on 20 Jun 2007, 08:45 AM
Hello Frank,

to setup manually  RadGridView columns you can use the next code snippet:

radGridView1.GridElement.BeginUpdate(); 
 
radGridView1.MasterGridViewTemplate.AutoGenerateColumns = false
radGridView1.MasterGridViewTemplate.Columns.Clear(); 
GridViewDataColumn col = new GridViewDataColumn("First"); 
radGridView1.MasterGridViewTemplate.Columns.Add(col); 
 
col = new GridViewDataColumn("Last"); 
col.HeaderText = "Last Name"
radGridView1.MasterGridViewTemplate.Columns.Add(col); 
 
col = new GridViewDataColumn("First"); 
col.HeaderText = "First Name"
col.UniqueName = "Test"; //map to same data column first with deference unique name 
radGridView1.MasterGridViewTemplate.Columns.Add(col); 
 
radGridView1.GridElement.EndUpdate(); 

I hope this helps.

 
Best wishes,
Julian Benkov
the Telerik team

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