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

Persiting grouping on Postback

3 Answers 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jurjen Ladenius
Top achievements
Rank 2
Jurjen Ladenius asked on 15 Jul 2008, 01:41 PM
Hello,

I have a RadGrid that is bound to a LinqDataSource. When I group and set the GroupDefaultExpanded to false, and when I do any type of postback it automatically folds everything back.

I would like it to preserve the status of the grouping when I do a postback. How can I do this?

Kind Regards,

Jurjen Ladenius

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 15 Jul 2008, 01:57 PM
Hello Jurjen,

I just tried this however didn't manage to reproduce such behavior - example attached.

Best wishes,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jurjen Ladenius
Top achievements
Rank 2
answered on 22 Aug 2008, 07:32 AM
Hello,

I looked at your example, and i decided to build my page again to find the problem.

The problem is that when I do the postback the backcolor of some of my rows have to change, and a checkbox must then be set to visible. To achive this I rebind my grid, the data in it is exactly the same.

Do you know a way so that I can keep the status of the grouping after rebinding? Or any other way how I can achieve the behaviour of changing color rows and setting check boxes to visible, without the rebinding? 

Thank you,

Kind regards,

Jurjen Ladenius
0
Nikita Gourme
Top achievements
Rank 1
answered on 22 Aug 2008, 12:07 PM
If I followed your idea correctly, I would go changing the checked state of the checkboxes or the background of some of the rows listening to the ItemCreated event of the grid (based on your own condition). Thus you will avoid the explicit rebind action which may collapse the expanded groups in the grid.

Other thing you may look at is to keep the expanded state of the groups saving the group indices in a custom manner. I recently found this code library project when searching for a similar solution for hierarchical grid - you may find it worthy.

Nikita
Tags
Grid
Asked by
Jurjen Ladenius
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Jurjen Ladenius
Top achievements
Rank 2
Nikita Gourme
Top achievements
Rank 1
Share this question
or