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.

help with grouped rows

Thread ID:

Created:

Updated:

Platform:

Replies:

55056 Jan 23,2007 09:05 AM Jan 31,2007 06:49 PM Windows Forms 3
loading
Tags: GridControl
Shachar Shimshon
Asked On January 23, 2007 09:05 AM

hi all.
in my grid i set a group field, and it's wotking fine.
is it possible when i have only 1 row, not to show it's group, and only when i have more then 1 row, it'l group them?


Administrator [Syncfusion]
Replied On January 23, 2007 10:52 AM

Hi Shachar,

You would have to derive a class from GridGroup. In your derived classes you need to override IsChildVisible.

Something like this:

public override bool IsChildVisible(Element el)
{
if( this != null && this.FilteredRecords != null
&& this.FilteredRecords.Count <= 1 )
return false;
else
return base.IsChildVisible(el);// Otherwise default behavior:
}


Please refer to the attached sample for more details.
GGCHideShowGroup.zip

Best Regards,
Haneef

Shachar Shimshon
Replied On January 29, 2007 09:50 AM

this example is'nt what i'm looking for because it makes all the rows that have only 1 row in there group to disappear.
what i want is that all the rows with more then 1 row inside the group will be grouped and the others, that dont have any "brothes" will be displaed but not in a group.
is it possible?

Administrator [Syncfusion]
Replied On January 31, 2007 06:49 PM

Hi Shachar,

Please try this code snippet in IsChildVisible override method and let me know if you are looking something different.

public override bool IsChildVisible(Element el)
{
if( this != null && this.FilteredRecords != null
&& this.FilteredRecords.Count <= 1 )
{
if( el.Kind == DisplayElementKind.Caption )
{
this.IsExpanded = true;
return false;
}
else if( el is GridRecordsDetails)
return true;
else
return false;
}
else
{
return base.IsChildVisible(el);// Otherwise default behavior:
}
}

Here is a modiifed sample.
GGCHideShowGroup_ae89e3bb.zip

Best Regards,
Haneef

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.

;