Hi
I'm trying to change colors in Header section of xamDataGrid.
I have this styles in resources file:
<Style TargetType="{x:Type igDP:DataRecordPresenter}">
<Setter Property="HeaderAreaBackground" Value="{DynamicResource MainGridHeaderGradient}"/>
</Style>
<Style TargetType="{x:Type igDP:LabelPresenter}">
<Setter Property="Background" Value="{DynamicResource MainGridHeaderGradient}"/>
<Setter Property="LabelHighlight" Value="{DynamicResource MainButtonGradientActive}"/>
<Style.Triggers>
<Trigger Property="IsPressed" Value="True">
<Setter Property="LabelHighlight" Value="{DynamicResource MainButtonGradientSelected}"/>
</Trigger>
</Style.Triggers>
This is almos, what I was looking for. But how to change background for column, that was clicked to sort data by it.
I checked in Mole, and element that is visible in that state is 'highlight_1', but how can I change it's background. Is there any property (like 'LabelHighlight' for 'MouseOver') or something?
Vista 32bit with service pack1
Hi lukgda,
What's the OS version you are running your application on ?
Best Regards,
Yanko
Unfortunately it doesn't work on my machine. I've run samle that you have attached, but with the same result.
Recently, we have updated our controls to NET Advantage 8.2. Maybe that's the cause?
Regards
In answer to your to your question - "how to change background for header section, and only for header section?"I would suggest the following solution, based on the style triggers approach:
<Style TargetType="{x:Type igDP:LabelPresenter}"> <Style.Triggers> <Trigger Property="SortStatus" Value="Ascending"> <Setter Property="Background" Value="Orange"/> </Trigger> <Trigger Property="SortStatus" Value="Descending"> <Setter Property="Background" Value="Yellow"/> </Trigger> </Style.Triggers></Style>
The attached ChangeXamDataGridSortedColumnHeader sample application contains the full solution implementation.
Best Regards,Yanko
Hi Yanko
Thanks for your reply.
But how to change background for header section, and only for header section?