Hi, here is my code:
void grdTradeHistory_Loaded(object sender, RoutedEventArgs e) { FieldLayout layout = this.grdTradeHistory.DefaultFieldLayout; RecordFilterCollection filters = layout.RecordFilters; RecordFilter filter = new RecordFilter(layout.Fields["Status"]); filter.Conditions.Add(new ComparisonCondition(ComparisonOperator.StartsWith, this.grdTradeHistory.Tag.ToString())); filters.Add(filter); layout.SortedFields.Add(new FieldSortDescription("OrderDate", System.ComponentModel.ListSortDirection.Descending, false)); }
When I change ObservableCollection<T> the grid not autosort the new result. It move bottom of the grid. As you see I sort by OrderDate and suppose new orders to be on top of the grid but it seems this not work.
Please advise.
Regards,
Saykor
Your answer help me to resort the grid after I add a new record so I thank you for this but i have a question about...
It is not suppose this sorting to work automatic? Why is need to raise a event and force the grid to resort every time when I add a record or edit the cell?
When I add a sort field then I expect the grid to sort every time when I add a new record or edit this cell.
Hello again,
I can say that there is a reason we made the sorting not to apply automatically. If you have many Records and you change one of its Fields’ Value, and there is automatic sorting, the Record will be sorted and will go to its new position and you will lose it. This is why there is method, so if you want, you can achieve this functionality by using it.
Hi Stefan,
Yes have a sence in this case but it is not more sence grid to have a flag something like SortingType="" FirstTimeOnly or Always(default value)... so user can choose what to do the grid.
In my case I not will set a flag. When I add a sort clause i expect to do this automatic.
In your case user can set the flag to SortingType="FirstTimeOnly".
Expected behaviour of the sorting is to be automatic.
Hello,
After some research, reapplying sorting automatically on adding ne Record has been determined to be a new feature request. I have sent your feature request directly to our product management team. Our product team chooses new feature requests for development based on popular feedback from our customer base. Infragistics continues to monitor application development for all of our products, so as trends appear in requested features, we can plan accordingly.
has been determined to be a new feature request. I have sent your feature request directly to our product management team. Our product team chooses new feature requests for development based on popular feedback from our customer base. Infragistics continues to monitor application development for all of our products, so as trends appear in requested features, we can plan accordingly.
We value your input, and our philosophy is to enhance our toolset based on customer feedback. If your feature is chosen for development, you will be notified at that time. Your reference number for this feature request is FR13732.
If you would like to follow up on your feature request at a later point, you may contact Developer Support management via email. Please include the reference number of your feature request in the subject and body of your email message. You can reach Developer Support management through the following email address: dsmanager@infragistics.com
Great,
Thank you