AD
Administrator
Syncfusion Team
February 11, 2005 09:09 PM UTC
Anthony,
Based on earlier conversations I assume you have custom GroupingEngine where you override Group and you use summaries in captions.
When you find a record you can set a flag in the parent group indicatting that a detail row meets the criteria. Then you override QueryCellStyleInfo and in that event handler you check if a summary row is queried. In that case you can check the parent group whether the mentioned flag was set and in that case change the backcolor of the summary row.
Code:
- Getting the parent group, e.g. when your
Group group = record.ParentGroup;
if (group is MyCustomGroup)
((MyCustomGroup) group).HighlightSummary = true;
else if (group is MyCustomChildTable)
((MyCustomChildTable) group).HighlightSummary = true;
In your MyCustomGroup and MyCustomChildTable classes you add a HighlightSummary flag.
A QueryCellInfo overide can look like this:
private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
Element el = e.TableCellIdentity.DisplayElement;
if (el is CaptionRow)
{
bool highlight = false;
Group group = el.ParentGroup;
if (group is MyCustomGroup)
highlight = ((MyCustomGroup) group).HighlightSummary;
else if (group is MyCustomChildTable)
highlight = ((MyCustomChildTable) group).HighlightSummary;
if (highlight && e.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionSummaryCell)
{
e.Style.BackColor = Color.Red; // your highlight color
}
}
}
Stefan