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

multi-edit automatically generated columns (pivot table)

1 Answer 116 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 12 Mar 2009, 10:33 PM
Hi All,

I've pivotted my data in my datasource (web service) and therefore I don't know how many columns I will have (or what their names will be) except the first few.

This thread was helpful -- http://www.telerik.com/community/forums/aspnet/grid/multi-row-edit-in-grid.aspx -- but it doesn't cover my situation as they have explicitly set the editItemTemplate, which I can't do.

I was able to get checkboxes in all of my cells(that's the goal) using the radgrid_ItemDataBound event and just cycling through all the columns adding the checkbox to the controls collection for each cell.  That feels dirty.  And, in my radgrid_ItemCommand event I'm not getting any data from the checkboxes anyway.

Can someone give me a tip to get rolling? 
I think I have two questions.
1) How SHOULD I be getting those checkboxes in there (all cells get one)
2) How do I get the data back.
Note that the columns are all automatically generated.
Thanks for any tips.
Tom B.

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 16 Mar 2009, 02:58 PM
Hi Tom,

Basically, RadGrid will create its auto-generated columns based on the data type of the underlying source columns/fields. This can seen on this online demo of the product where it is compared to the regular MS GridView control:

http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/migration/defaultcs.aspx

Another option would be to generate template columns with checkboxes programmatically inside the OnInit handler of the page as explained in this help topic.

If you would like to inject controls in your bound columns dynamically, you can utilize the approach presented in the following code library thread on our site:

http://www.telerik.com/community/code-library/aspnet-ajax/grid/adding-custom-column-dynamically.aspx

and convert the code following the guidelines from here:
http://www.telerik.com/help/aspnet-ajax/grdmigrationtoprometheus.html

Best regards,
Sebastian
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Tom
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Share this question
or