Hi
When switching from multi to single sort the un-selected fields SortStatus get cleared and the selected field's SortStatus changes to the next SortStatus . How can i change it that the selected field's SortStatus is always eg. ascending? I've tried clearing FieldLayouts SortedFields and adding a new FieldSortDescription as well as overriding OnSorting and passing a new SortingEventArgs but they didn't work.
Hello,
Thank you for your post. I have been looking into it and I suggest you look in the Feature Browser of WPF 11.2 under xamGrid / Organization / Sorting section, where it is shown how to enable MultipleSort. You just need to hold Ctrl after Sort by one Column to be able to Sort by second one. Please let me know if this helps you or you need further clarifications on this matter.
Looking forward for your reply.
how can i do that with xamgrid in silver-light ?
Thanks for the response. The solution worked.
I've got further question with regards to this. When i'm in multi sort selecting another field, the selected field doesn't get the unselected status even though i've set LabelClickAction to SortByMultipleFieldsTriState. Is there a way to change this or is the above solution the only way?
HI,
I am just following up on this forum thread.
Please let me know if I can provide further assistance regarding this issue.
Sincerely, MattDeveloper Support Engineer
H Mheusser,
You can wire up the XamDataGrid's sorting event and replace the existing sort.
Here is a code snippet:
void xamDataGrid1_Sorting(object sender, Infragistics.Windows.DataPresenter.Events.SortingEventArgs e)
{
e.Cancel =
true;
e.ReplaceExistingSortCriteria =
FieldSortDescription fsd = new FieldSortDescription();
fsd.Direction = e.SortDescription.Direction;
fsd.Field = xamDataGrid1.FieldLayouts[0].Fields[
"SSN"];
fsd.FieldName =
"SSN";
xamDataGrid1.FieldLayouts[0].SortedFields.Add(fsd);
xamDataGrid1.FieldLayouts[0].SortedFields.Add(e.SortDescription);
}