BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Query |
Response |
how can I show only the group that have more than 10 items |
Suggestion 1
In order to display the groups based on their grouped items count, the QueryRecordMeetsFilterCriteria event can be used. In that event, the GetChildCount() method can be used to get the grouped items count and e.Result property used to display/hide groups. Please make use of below code and sample,
//Event Triggering
this.gridGroupingControl1.QueryRecordMeetsFilterCriteria += GridGroupingControl1_QueryRecordMeetsFilterCriteria;
//Event Customization
private void GridGroupingControl1_QueryRecordMeetsFilterCriteria(object sender, Syncfusion.Grouping.QueryRecordMeetsFilterCriteriaEventArgs e)
{
if (this.gridGroupingControl1.TableDescriptor.GroupedColumns.Count > 0)
{
//To display the grouped items based on grouped items count
if (e.Record.ParentGroup.GetChildCount() > 10)
e.Result = true;
else
e.Result = false;
e.Handled = true;
}
}
|
Suggestion 2
You can also create a custom GroupingEngine and override the IsGroupVisible() property to display the groups based on the items count. Please make use of below code and sample,
public class GroupingTable : GridGroup
{
public GroupingTable(Section parent)
: base(parent)
{
}
//Overridden to display the grouped items which are greater than 10
protected override bool IsGroupVisible()
{
//To get the grouped items count
if (GetFilteredRecordCount() > 10)
return true;
else
return false;
}
} |