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.
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);
}
Sincerely, MattDeveloper Support Engineer
how can i do that with xamgrid in silver-light ?
HI,
I am just following up on this forum thread.
Please let me know if I can provide further assistance regarding this issue.