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
370
Style SortIndicator in XamTreeGrid
posted

Hi,

How can I change the color of the SortIndicator in my columns in my XamTreeGrid. I also need to change the color of the line under the header of the sorted column. 

BR,

Hilma Maria

Parents
No Data
Reply
  • 34810
    Verified Answer
    Offline posted

    Hello Hilma,

    I have been investigating into the behavior you are looking to achieve, and I would recommend that you take a look at the sample project I am attaching to this post.

    I am under the impression that by the “color of the line under the header of the sorted column,” you are referring to the light-blue border that shows up by default under the column when it is sorted. In this case, I would recommend that you include the default Aero style in Windows 10 for the LabelPresenter element, which can be found in the DataPresenterAero_Express.xaml file commonly found at the following directory with Infragistics controls installed:

    C:\Program Files (x86)\Infragistics\<version>\WPF\DefaultStyles\DataPresenter

    Inside the LabelPresenter’s ControlTemplate, you will find a SortIndicator element, which you can set the Background color of. Normally, I would just recommend styling this element, but since you want to modify the underline as well, the default style is needed, as the other element is a Border in the same ControlTemplate named “highlight_2.” In the sample, I have changed its BorderBrush to “Red” as well as removed the 1 pixel thickness from its Left side so that it will only appear as an underline.

    I am attaching the sample project to demonstrate. I hope this helps you.

    Please let me know if you have any other questions or concerns on this matter.

    TreeGridSortIndicatorStyle.zip

Children