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

Grid Losing State

3 Answers 108 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike Patterson
Top achievements
Rank 1
Mike Patterson asked on 03 Mar 2009, 11:09 PM
Hello,

I have a grid that has the GroupsDefaultExpanded property set to false.  When I expand a group and click the edit button for a record, all the groups collapse as if the page just loaded again keeping me from being able to edit any items.  Is there a way to prevent this?  It seems as if every postback none of the current states for the grid are kept.

Thanks.

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Mar 2009, 03:56 AM
Hi Mike,

Here is a code library submission which shows how to persist the expanded state of the Groups on rebind. Go through it and see if it helps.
Persist Groups Expanded State on Rebind

Thanks
Shinu



0
Mike Patterson
Top achievements
Rank 1
answered on 04 Mar 2009, 04:21 AM
Shinu,

Thanks for the reply.  Could you let me know if this would this also fix the following issue?  I am adding a user control to the group header in the ItemDataBound event.  When a postback occurs such as when I expand a detail table inside any of the groups, I lose the user control in the header and it defaults back to the text that would normally be there based on the GroupByExpressions.  I can attach some code and screen shots if this doesn't make any sense.  Again, thanks for the reply.

Thanks,
Mike
0
Shinu
Top achievements
Rank 2
answered on 05 Mar 2009, 06:57 AM
Hi Mike,

Try adding the UsreControl to the GridGroupHeaderItem in both the ItemCreated and ItemDataBound events and see whether it is working.

Shinu
Tags
Grid
Asked by
Mike Patterson
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Mike Patterson
Top achievements
Rank 1
Share this question
or