Background color for grid header and filter button

Not Answered This post has 0 verified answers | 9 Replies | 1 Follower Thread's RSS feed.

leggli
Points 230
Replied On: Fri, Jun 26 2009 1:29 PM Reply

Hello,

I'm trying to change the background color of a Column Header (blue background) and the Filter Clear button (white background). 

In the case of the Column Header, I have tried to re-style the LabelPresenter with limited success.  I am able to change the Foreground color, the LabelHighlight, but when I set the Background color nothing happens.  Using Snoop I can see that the Background color is set inside of an element called CardPanel (hightlist_2, not sure where this is defined).

In the case of the Filter Button, I have tried to change the background in the DataRecordPresenter and also the RecordSelector.  According to Snoop, the color is stored in the Mainborder.  Once again, accessing th background property for this is not obvious.

I really don't want to create a new template for either of these as all I want to do is change the background I'm surprised there isn't a functioning property to set the background for either of these as I would think changing the background would be a commonly used feature.

Any help would be greatly appreciated.

 

  • Post Points: 20

All Replies

John Doe
Points 69,426
Infragistics Employee
Replied On: Mon, Jun 29 2009 1:18 AM Reply

Hello,

The background property of the RecordSelector (where these elements appear) is bound to the Fill property of the paths (RecordSelector,FilterButton). This is so, because it is a path element and its background is its fill rather than the background of the area around it. 

You are correct - the element MainBorder (Grid) holds the background of the area around the RecordSelectors. You can see the default xaml files that we ship in the DefaultStyles directory and get from there the default style for the RecordSelector. From there you can easily change the color that you want.

You can do the same for the Labelpresenter, however, I do not understand why simply changing the background does not work with you.

<Style TargetType="{x:Type igDP:LabelPresenter}">

<Setter Property="Background" Value="Green"/>

 </Style>

Please provide the xaml you are using for the LabelPresenter in your next post so that we can look into it.

Sincerely,
Alex Fidanov
Developer Support Engineer
www.infragistics.com\support

  • Post Points: 20
leggli
Points 230
Replied On: Mon, Jun 29 2009 6:07 PM Reply

Hello,

1. So I do need to make a clearification about my original post.  I am able to change the background of the column header.  The problem I'm having is changing the background of the sort button (blue element labeled "Device Name" in attached image.).  I think it's just a button?

Here is my LabelPresenter style:

        <Style TargetType="{x:Type xamDataGrid:LabelPresenter}">
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="LabelHighlight" Value="Gray"/>
            <Setter Property="InnerBorderBrush" Value="#FF474747"/>
            <Setter Property="OuterBorderBrush" Value="#FF535353"/>
            <Setter Property="BorderBrush" Value="#FF535353"/>
        </Style>

2. I'm also having a hard time finding the the background for the filter clear button (the White Button on the left of the the attached image).

3. Finally, how do I change the background of the Filter options, currently it's white (see second image)? 

 

 

  • Post Points: 20
John Doe
Points 69,426
Infragistics Employee
Replied On: Tue, Jun 30 2009 8:27 AM Reply

I am attaching a sample project with custom sorting indicator and custom clear record filter button.

Hope this helps.

Sincerely,
Alex Fidanov
Developer Support Engineer
www.infragistics.com\support

  • Post Points: 35
leggli
Points 230
Replied On: Tue, Jun 30 2009 12:39 PM Reply

Hi Alex,

Thanks for the sample xaml.  So how do I change the Blue gradient background of the control that contains the SortIndicator?

Also, how do I hide the column in which the FilterRecordClearButton resides?

 

Thanks

  • Post Points: 5
leggli
Points 230
Replied On: Tue, Jun 30 2009 12:43 PM Reply

Also, the background color of the filter selector scroll box.

Thanks

  • Post Points: 20
John Doe
Points 69,426
Infragistics Employee
Replied On: Wed, Jul 1 2009 7:03 AM Reply

The dropdown of the Filter DropDown cannot be customized for now. The only way that I know of is with a style for the ComboBoxItem. The FilterRecordClearButton is actually the RecordSelector for that records, so in order to remove that, you need to hide the RecordSelector.

You can set that with the RecordSelectorLocation property of the FieldLayoutSettings object of the XamDataGrid.

Hope this helps.

Sincerely,
Alex Fidanov
Developer Support Engineer
www.infragistics.com\support

  • Post Points: 20
leggli
Points 230
Replied On: Wed, Jul 1 2009 4:05 PM Reply

Great! Almost there. 

The last two things I need to change are the Blue gradient background of the UI element that contains the  SortIndicator and the white border. See the previous screen captures.  In Snoop I am able to see two LabelPresenters (both of my headers) in the VirtualizingDataRecordCellPanel.  I need to modify the background of the highlight_2 and the BorderBrush of the WhiteInnerBorder inside of each LabelPresenters.

Many Thanks

 

  • Post Points: 20
John Doe
Points 69,426
Infragistics Employee
Replied On: Thu, Jul 2 2009 1:58 AM Reply

Using the default style, you can set the LabelHightligh property to transparent, remove the border responsible for highlighting. You should also remove the triggers and storyboards, which targetname is this border.

Sincerely,
Alex Fidanov
Developer Support Engineer
www.infragistics.com\support

  • Post Points: 20
leggli
Points 230
Replied On: Thu, Jul 2 2009 10:26 AM Reply

How do you change the background (Gradient blue, see screen captures) color?

  • Post Points: 5
Page 1 of 1 (10 items) | RSS