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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Changing filter resets Expanded status in hierirchical DataBoundGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

20315 Oct 14,2004 02:18 AM UTC Oct 15,2004 10:58 PM UTC WinForms 2
loading
Tags: GridControl
Michael Feinstein
Asked On October 14, 2004 02:18 AM UTC

When I change filter value in DataBoundGrid it resets Expanded\Collapsed status of child rows. Is there a way to preserve the information ? I tried catching FilterBarTextChanged event and restore it manually, but it appears that grid is reset after the event is fired, so it does not help. Another question: I have a parent\child relation table where not all parents have children. At the moment after initalizing grid I call first ExpandAll() then immediately CollapseAll() method, this way only parent records that have child records have little + sign next to them. Is there any way to automate the process ?

Administrator [Syncfusion]
Replied On October 14, 2004 06:28 AM UTC

Here is forum thread that discusses saving the expand state during a sort. I think you can use a similar techique for the filter. It takes some coding. Both filtering and sorting trigger a ListChanged.Reset event that the grid responds to by resetting the grid which is causing this behavior. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=16065 It is a little trickier to find the place to save and restore teh state when you filter than when you sort. But I thnk this derived grid will show you where to do it.
public class MyGridDataBoundGrid : GridDataBoundGrid
{
	protected override void OnCellClick(GridCellClickEventArgs e)
	{
		//Save state here
		base.OnCellClick (e);
	}
	protected override void OnCellButtonClicked(GridCellButtonClickedEventArgs e)
	{
		//Save state here
		base.OnCellButtonClicked (e);
		}
	protected override void OnCurrentCellCloseDropDown(Syncfusion.Windows.Forms.PopupClosedEventArgs e)
	{
		base.OnCurrentCellCloseDropDown (e);
		//restore state here
	}
}
There is no property setting that will control whether you see a + on a parent with no children. But here is a forum thread that discusses how you can handle this. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=8517

Administrator [Syncfusion]
Replied On October 15, 2004 10:58 PM UTC

I found a somewhat workaround solution - attach to DataView event (listchanged) and reset +/- from there. It''s a bit strange that there is no event on "filter done working", may I suggest adding one ? >Here is forum thread that discusses saving the expand state during a sort. I think you can use a similar techique for the filter. It takes some coding. Both filtering and sorting trigger a ListChanged.Reset event that the grid responds to by resetting the grid which is causing this behavior. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=16065 > >It is a little trickier to find the place to save and restore teh state when you filter than when you sort. But I thnk this derived grid will show you where to do it. >
>public class MyGridDataBoundGrid : GridDataBoundGrid
>{
>	protected override void OnCellClick(GridCellClickEventArgs e)
>	{
>		//Save state here
>		base.OnCellClick (e);
>	}
>	protected override void OnCellButtonClicked(GridCellButtonClickedEventArgs e)
>	{
>		//Save state here
>		base.OnCellButtonClicked (e);
>		}
>	protected override void OnCurrentCellCloseDropDown(Syncfusion.Windows.Forms.PopupClosedEventArgs e)
>	{
>		base.OnCurrentCellCloseDropDown (e);
>		//restore state here
>	}
>}
>
> >There is no property setting that will control whether you see a + on a parent with no children. But here is a forum thread that discusses how you can handle this. >http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=8517

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.

Warning Icon 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.Close Icon

;