5 Answers, 1 is accepted
0
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
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!
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!
Thank you!
0
Hello Frank,
to setup manually RadGridView columns you can use the next code snippet:
I hope this helps.
Best wishes,
Julian Benkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
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