Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
How to change the background color of the header area?
posted

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 :) 

Parents
No Data
Reply
  • 80
    posted

    I finally achieved to change the background color of the header area.

    Links for help: http://ko.infragistics.com/community/forums/p/56753/290614.aspx (2nd post)

    Link number 2: http://ko.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.

Children