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

Change group value coming from database

1 Answer 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 1
Darren asked on 20 Jul 2011, 10:24 PM
Hi, I want to know if when using grouping if it is possible to change the group for an item. I have an item that has Group A in the database, but in the vb code-behind I need to change the item to Group B so it gets reported under Group B. I have tried changing the  GridItem("MyGroup").Text  in the ItemDataBound event, but the item doesn't appear under the correct group (even though the text has been changed.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 26 Jul 2011, 08:34 AM
Hello Darren,

Changing the text for the corresponding cell of the grid will not make any change in the grouping of the current item.
The workaround that I can think of is to get the data from the datasource into one DataTable. Then add a new column that you will use to group by. You could populate data in the new created column using fields of the rest of the columns depending on what you want to group by and which records you want to switch groups. Finally you could use this DataTable to bind the grid. However in this solution you will not able to use automatic inserts/updates/deletes.

Regards,
Vasil
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Grid
Asked by
Darren
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Share this question
or