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
250
Styling the column headers
posted

I've figured out how to style the background, border, and mouseover background colors by creating a style for the LabelPresenter. However I can not figure out any way to set:

- Border color when moused over

- Background color for the header of the column that is currently sorted

Are there there properties exposed that I can set to customize these two things? I'd greatly prefer to not be forced to re-template the entire LabelPresenter just to change its colors.

  • 2677
    posted

    Hello,

    You do not have to retemplate the whole thing, but you will have to bring in the default LabelPresenterStyle and add some Setters to pre existing triggers.  For the sorting aspect, you can find the SortStatus Trigger for Ascending and Descending and add the following.

    <Setter TargetName="background" Property="Background" Value="Red"/>
    <Setter TargetName="highlight" Property="Background" Value="Red"/>

    Then, for the ismouseOver, you can do something very similar.  There is a pre existing MultiTrigger for IsMouseOver.  To this, you can just add two more setters like the following.  There are two borders that you can play with.  Most likely, you will use lineOuter.

    <Setter TargetName="lineOuter" Property="BorderBrush" Value="Red"/>
    <Setter TargetName="lineInner" Property="BorderBrush" Value="Orange"/>

    You can find the Default LabelPresenterStyle in the following location if you have a default install.

    C:\Program Files\Infragistics\NetAdvantage 2010.3\WPF\DefaultStyles\DataPresenter\DataPresenterGeneric_Express.xaml

     

    If you have any questions, please let me know.