This is a migrated thread and some comments may be shown as answers.

Background color of group header row

2 Answers 316 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Lou
Top achievements
Rank 1
Lou asked on 10 Aug 2015, 09:08 PM

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.

How would I do that?

 -Lou

2 Answers, 1 is accepted

Sort by
0
Lou
Top achievements
Rank 1
answered on 10 Aug 2015, 09:50 PM

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
Tags
GridView
Asked by
Lou
Top achievements
Rank 1
Answers by
Lou
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or