We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Hierarchical GDBG grid

Thread ID:

Created:

Updated:

Platform:

Replies:

45504 Jun 22,2006 06:41 AM Jun 23,2006 05:32 PM Windows Forms 3
loading
Tags: GridControl
Kai
Asked On June 22, 2006 06:41 AM

Hi, I have a GDBG with data relation. Whenever I call grid.Refresh(), all the expanded rows will be collapsed. Is there a way to solve it? I tried to set OptimizeListChangedEvent=false and it seems that whenever I got an extra row added to the datatable, the "+/-" will be messed up. My guess is because the rowIndex has been changed, so the row state has become wacky. Also, another problem with Refresh is that if the user is modifying a cell and then the grid got refreshed, the value that the user entered will be lost. Is there any way to solve this?

Administrator [Syncfusion]
Replied On June 22, 2006 01:35 PM

Hi Kai, These issues happen, when the grid datasource or filter is reset. To maintain the state of row expanded / collapsed, you need to save the state and restore it after reset. Here is sample which demonstrates the way to maintain the state. Sample : ExpandGrid.zip You can call the Binder.EndEdit method to save the current cell value, before reset. Thanks and regards, Madhan

Kai
Replied On June 23, 2006 03:52 AM

I have now fixed my problem by using OptimizeListChange = true and Save the Row state (Expand/Collapse) before calling BeginUpdate and Restoring the row state after ResumeBinding. i.e. SaveState(); grid.BeginUpdate(); grid.Binder.SuspendBinding(); // do my update here grid.Binder.ResumeBinding(); RestoreState(); grid.EndUpdate(); Everything works fine EXCEPT the current cell keeps rolling down (to the number of child rows that I have on screen) whenever I have some row expanded and the dataset updated. Did I miss something? how can I preserve the CurrentCell''s position and state? Many thanks. >Hi Kai, > >These issues happen, when the grid datasource or filter is reset. To maintain the state of row expanded / collapsed, you need to save the state and restore it after reset. Here is sample which demonstrates the way to maintain the state. > >Sample : ExpandGrid.zip > >You can call the Binder.EndEdit method to save the current cell value, before reset. > >Thanks and regards, >Madhan

Administrator [Syncfusion]
Replied On June 23, 2006 05:32 PM

Hi Kai, Please try the following steps to avoid this problem. I hope this helps to sort out the issue. ++++++++++++ // Save the current cell position SaveState(); this.gridDataBoundGrid1.ShowCurrentCellBorderBehavior = GridShowCurrentCellBorder.HideAlways; grid.BeginUpdate(); grid.Binder.SuspendBinding(); // do my update here grid.Binder.ResumeBinding(); RestoreState(); this.gridDataBoundGrid1.ShowCurrentCellBorderBehavior = GridShowCurrentCellBorder.AlwaysVisible; // Restore the currentcell position grid.EndUpdate(); ++++++++++++ Best regards, Madhan

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;