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

[Solved] Add last column to autogenerated columns

3 Answers 160 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stefan Kamphuis
Top achievements
Rank 2
Stefan Kamphuis asked on 25 Sep 2009, 07:57 AM
Hi,

I'm using the asp.net radgrid in a project and I'm using the autogenerate columns feature. Now, I'd like to add a column to the autogenerated ones, and it needs to be the last column in the grid.

I can add a first column declaratively, but is there any way to add a last column?

Thanks.

Stefan

3 Answers, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 26 Sep 2009, 12:56 PM
Hello Stefan,

An autogenerated column is created for every field of the data source to which the table view is bound. Hence adding another autogenerated column would require to create a new data field in the data source and then bind the TableView (or rebind the TableView if it was bound before the new data filed was created). You can read more about the different column types here.

I hope this helps

Regards,
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
Stefan Kamphuis
Top achievements
Rank 2
answered on 28 Sep 2009, 07:51 AM
Thanks for your answer, but I need to add a commandcolumn, actually, not an autogenerated column. I guess my question wasn't really clear at this point, sorry.

So in addition to the autogenrated data columns, I need to add a buttoncolumn as last (rightmost) column.

Any more ideas?

Thanks,
Stefan
0
Martin
Telerik team
answered on 28 Sep 2009, 03:24 PM
Hello Stefan,

Here is a small quote of our documentation about explicitly created columns:

Explicitly-created columns (columns created in the Property Builder or at runtime) are added to the Columns property collection. They appear in the table view in the order in which they are declared and before any automatically-generated columns (unless you order the columns programmatically).

For more details about the different column types please view Column types.

You can also check:

Reordering columns.
Adding Columns Programmatically.

Regards,
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.
Tags
Grid
Asked by
Stefan Kamphuis
Top achievements
Rank 2
Answers by
Martin
Telerik team
Stefan Kamphuis
Top achievements
Rank 2
Share this question
or