Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6324223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:39:51+00:00 2026-05-24T16:39:51+00:00

Having trouble keeping expanded groupings expanded when the XtraGrid’s datasource is reassigned. BACKGROUND Form

  • 0

Having trouble keeping expanded groupings expanded when the XtraGrid’s datasource is reassigned.

BACKGROUND

Form has XtraGrid on the left and a Vertical Grid on the right. The XtraGrid is a controller for the form.

User drags a column (e.g. Customer) to the group header. Then expands several customers to see their order header detail. Then the user either:

— clicks on one of the orders, which fetches the order detail from the database and populates the vertical grid on the right hand side of the form, where the user can make edits and then Save the changes.

OR

— clicks on Add New on a menu which presents a blank vertical grid, which the user can complete and Save.

After the update or the insert, the datasource that populates the XtraGrid on the left hand side of the page is completely renewed — another query is issued against the database, which returns a DataTable that is assigned to the grid’s datasource property; and then the focus is set to the updated row or to the newly inserted row:

  DevExpress.XtraGrid.Views.Base.ColumnView  vw;
  vw = MyXtraGrid.DefaultView as DevExpress.XtraGrid.Views.Base.ColumnView;
  // <snip> routine to determine the row
  vw.FocusedRowHandle = i

However…..

I want to leave all of the user’s expanded customers expanded. So, before the Save or Insert, I invoke a SaveGridLayout method:

 private void SaveGridLayout()
  {
  (ControllerList as DevExpress.XtraGrid.GridControl).MainView.SaveLayoutToStream(GridLayoutStream);    
  }

and the, after the grid’s datasource has been reassigned after the update or insert, and the focused row has been reset, I invoke a RestoreGridLayout method:

 private void RestoreGridLayout() 
 {
 ( ControllerList as DevExpress.XtraGrid.GridControl).MainView.RestoreLayoutFromStream(GridLayoutStream);
 }

GridLayoutStream is a variable with form-scope, BTW.

But this approach is not working. The expanded groups are getting closed up. Is what I’m doing wrong evident to anyone?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T16:39:51+00:00Added an answer on May 24, 2026 at 4:39 pm

    If I am not mistaken, the XtraGrid does not preserve the information about expanded group rows. Use the approach from the How to preserve the XtraGrid View state article as a workaround to this limitation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble keeping my app responsive to user actions. Therefore, I'd like to
I am having trouble keeping my first and second rows of my main PdfPTable
I am having trouble keeping a ListBox updated with child objects. I'm using two
In a GWT app centered around a canvas, I'm having trouble keeping focus directed
I am having trouble keeping the state of my Mac OS X app (running
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I'm having some trouble keeping apart the terms class, object, variable and datatype. can
I have been having trouble keeping up with the list of changes in 1.3
Hi I am having trouble keeping connection with my MongoDB and it ends up
I am just starting out with network programming and I am having trouble keeping

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.