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

[Solved] Is it possible to insert auto-generated columns?

2 Answers 165 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gary
Top achievements
Rank 2
Gary asked on 22 Jan 2010, 12:40 AM
I have a RadGrid with 3 columns defined in markup.  The remaining X number of columns are auto-generated.  Auto-generated columns are always added to the right of the grid appearing after the 3 pre-defined columns.  Is it possible to have the auto-generated columns inserted into a specific column position?  Or is there an event that knows when the last auto-generated column was added, so I can then programmatically add one or more pre-defined columns?  To date, I have used SwapColumns method to move 2 predefined columns to the right-side of the grid, but I have a scenario where that may not work.  TIA, Gary.

2 Answers, 1 is accepted

Sort by
0
Accepted
Martin
Telerik team
answered on 26 Jan 2010, 04:38 PM
Hello Gary,

The auto-generated columns are created when the grid is bound whilst the declarative columns are created much earlier - when the grid is created. As a result the auto-generated columns are always appended to the last declarative column. The only way to change this arrangement is to manually reorder the columns after their creation.

For more information about RadGrid columns I would suggest you to review the following help article:

Column types

As to the "event" part of the question - RadGrid provides the ColumnCreated Event that is fired for auto-generated columns only.

I hope you find this information helpful
Martin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Gary
Top achievements
Rank 2
answered on 26 Jan 2010, 11:10 PM
okay, pretty much what I expected.   Will look into the event.  Thanks.
Tags
Grid
Asked by
Gary
Top achievements
Rank 2
Answers by
Martin
Telerik team
Gary
Top achievements
Rank 2
Share this question
or