I am having a hard time to change the background color of the header area.
Attached is my header area today. I've sat custom background color on the labelPresenter area. What I would like to achieve is to set the white background color to the same as the LabelPresenter area.
When tracing my WPF application with Snoop, the result is that to change the background I need to access some kind of SpacerFill inside a Grid inside a DataRecordPresenter. And to change the white handlers which usually resizes the columns, I need to access some kind of WhiteInnerBorder burried inside a HeaderPresenter.
Well, I am hoping for some help to achieve this. Thanks :)
Just realized this is not the right property for what I am trying to do. Thank you anyway. Unsure how to remove post.
Is there a way to make this work at the Field level? I need to have each header a different color but when I try to add this in <dataPresenter:Field Name="Name"></dataPresenter:Field Name="Name> I get an error: The type 'Field' does not support direct content
Hello Jonas,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
I finally achieved to change the background color of the header area.
Links for help: http://es.infragistics.com/community/forums/p/56753/290614.aspx (2nd post)
Link number 2: http://es.infragistics.com/community/forums/t/45963.aspx
The property is called
<Setter Property="HeaderAreaBackground" Value="Green" />
My complete implementation for those who would like that is:
<dataPresenter:XamDataGrid.FieldLayoutSettings> <dataPresenter:FieldLayoutSettings AutoGenerateFields="False" HighlightAlternateRecords="False"SelectionTypeRecord="Single" FilterUIType="Default"AutoFitMode="Never"> <dataPresenter:FieldLayoutSettings.DataRecordPresenterStyle> <Style TargetType="{x:Type dataPresenter:DataRecordPresenter}" > <Setter Property="HeaderAreaBackground" Value="#595959" /> </Style> </dataPresenter:FieldLayoutSettings.DataRecordPresenterStyle> </dataPresenter:FieldLayoutSettings> </dataPresenter:XamDataGrid.FieldLayoutSettings>
Still working on those handlers though.