Occurs whenever a grouped cell that contains an aggregate is to be rendered and C1DisplayColumn.FetchStyle is true.
[Visual Basic]
Public Event FetchGroupCellStyle As FetchCellStyleEventHandler
[C#]
public event FetchCellStyleEventHandler FetchGroupCellStyle
[Delphi]
public property FetchGroupCellStyle: FetchCellStyleEventHandler read remove_FetchGroupCellStyle write add_FetchGroupCellStyle;
Example
The following code displays all values over 1000 in blue when the MSRP column is grouped:
Private Sub C1TrueDBGrid1_FetchGroupCellStyle(ByVal sender As Object, ByVal e As C1.Win.C1TrueDBGrid.FetchCellStyleEventArgs) Handles C1TrueDBGrid1.FetchGroupCellStyle
Dim N As Integer
N = Val(Me.C1TrueDBGrid1.Columns("MSRP").CellText(e.Row))
If N > 1000 Then
e.CellStyle.ForeColor = System.Drawing.Color.Blue
End If
End Sub
· C#
private void c1TrueDBGrid1_FetchGroupCellStyle(object sender, C1.Win.C1TrueDBGrid.FetchCellStyleEventArgs e)
{
int N;
N = Val(this.c1TrueDBGrid1.Columns["MSRP"].CellText(e.Row));
if (N > 1000)
{
e.CellStyle.ForeColor = System.Drawing.Color.Blue;
}
}
· Delphi
procedure TWinForm.C1TrueDBGrid1_FetchGroupCellStyle(sender: System.Object, e: C1.Win.C1TrueDBGrid.FetchCellStyleEventArgs);
var
N: Integer;
begin
N := Int32.Parse(Self.C1TrueDBGrid1.Columns['MSRP'].CellText(e.Row));
if N > 1000 then
e.CellStyle.ForeColor := System.Drawing.Color.Blue;
end;
For more details on cell styles, see Applying Cell Styles by Custom Criteria.
See Also
C1TrueDBGrid Class | C1TrueDBGrid Members | C1.Win.C1TrueDBGrid Namespace
Send comments about this topic to ComponentOne. Copyright © ComponentOne LLC. All rights reserved. |