I have implemented custom grouping for a GridView and would like to change the group header background color for some groups based on the grouped rows.
Never mind - I found the documentation for how to do this. Here's the code I used:
If TypeOf e.CellElement.RowInfo Is GridViewGroupRowInfo Then
If (condition) Then
e.CellElement.RowElement.BackColor = Color.Red
e.CellElement.RowElement.GradientStyle = GradientStyles.Solid
e.CellElement.RowElement.DrawFill = True
Else
e.CellElement.RowElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local)
e.CellElement.RowElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local)
e.CellElement.RowElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local)
End If
End If
0
Dimitar
Telerik team
answered on 11 Aug 2015, 08:55 AM
Hi Lou,
Using the formatting events is the correct solution. If you have any questions, please do not hesitate to contact us.
Regards,
Dimitar
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items