I am using the xamDataGrid and have different sorting requirements. I have a checkbox that when checked will use the default sorting functionality provided by Infragistics (ascending, descending, null). When not checked I am applying my own sorting behind the scenes and bind that data to the grid. When doing this I need the sort indicator to show in the column header.
I have seen the post http://community.infragistics.com/forums/p/23815/87197.aspx#87197 that describes creating a new style in the xaml. This turned on the sort indicator for all column all the time.
I'm hooking into the "Sorted" event on the grid which passes "SortedEventArgs" as the parameter. This is where I am trying to apply the logic for using Infragistics sort or my custom sort. From the code behind file I need to be able to turn on and off the sort indicator visibility for a specific column. While doing this I also need to turn off and on the built in sorting (ascending, descending, null) functionality. Any help into what properties control this would be greatly appreciated.
Hello,
You can use something like this to get to the SortIndicator:
SortIndicator s = Infragistics.Windows.Utilities.GetDescendantFromType(xamDataGrid1 as DependencyObject,typeof(SortIndicator),false) as SortIndicator;
You can also use GetDescendantFromName looking for "SortIndicator", which is the default name of that element inside the ControlTemplate of the LabelPresenter. This way you can control the visibility.
You can also use triggers to do this with binding.
> While doing this I also need to turn off and on the built in sorting (ascending, descending, null) functionality.
This is controlled by the LabelClickAction property of the FieldSettings.
I found this forum post as well that seems to be having the same issue but has yet to receive any responses:
http://news.infragistics.com/forums/p/12236/45799.aspx#45799