Hi,
Please tell me how to achieve something like this:
In this instance I only want to set the column header text but say i want to programmatically access a column for any reason I can't see a method to allow me to do this by key and it is impossible to know the index of the column
Please tell me how to achieve something like this:
RadGrid1.MasterTableView.AutoGeneratedColumns[
"somecol"].HeaderText = "My Column";
In this instance I only want to set the column header text but say i want to programmatically access a column for any reason I can't see a method to allow me to do this by key and it is impossible to know the index of the column
4 Answers, 1 is accepted
0
Accepted
Hello Al,
You can customize the properties of grid columns at runtime by providing a handler for the grid's ColumnCreated/ PreRender event and using a column UniqueName property. For more information you can refer to the help article below:
Using columns(Customizing columns programmatically section)
I hope this gets you started properly.
Kind regards,
Pavlina
the Telerik team
You can customize the properties of grid columns at runtime by providing a handler for the grid's ColumnCreated/ PreRender event and using a column UniqueName property. For more information you can refer to the help article below:
Using columns(Customizing columns programmatically section)
I hope this gets you started properly.
Kind regards,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Al
Top achievements
Rank 1
Iron
Iron
Iron
answered on 29 Jun 2010, 10:49 AM
Thanks Pavlina the ColumnCreated event works just fine for customizing AutoGeneratedColumns.
Is it possible to access an auto generated column by name after the grid has been rendered?
eg. GridColumn gc = RadGrid1.MasterTableView.AutoGeneratedColumns["somecol"];
Is it possible to access an auto generated column by name after the grid has been rendered?
eg. GridColumn gc = RadGrid1.MasterTableView.AutoGeneratedColumns["somecol"];
0
Hello Al,
To achieve your goal you could handle on ItemDataBound/ItemCreated event. For more information about how to access AutoGeneratedColumns you can also examine this help topic.
Kind regards,
Pavlina
the Telerik team
To achieve your goal you could handle on ItemDataBound/ItemCreated event. For more information about how to access AutoGeneratedColumns you can also examine this help topic.
Kind regards,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Al
Top achievements
Rank 1
Iron
Iron
Iron
answered on 29 Jun 2010, 02:29 PM
Thanks Pavlina, that info looks like it may be what I was after. My main question about the column titles has been answered above.