Version

About Fixed Records and Sorting

When your end users sort a DataPresenter control that contains fixed records, the fixed records will be sorted amongst themselves. If you do not want sort operations to modify the order of fixed records, you can set a FieldLayoutSettings object’s FixedRecordSortOrder property to FixOrder.

If your end users fix records after a sort operation, the DataPresenter control will not re-sort the fixed records. Fixed records are added to the fixed-records list so they are closest to the scrollable area of the DataPresenter control. This means that records fixed to the top will be added to the bottom of the fixed-records list and records fixed to the bottom will be added to the top of the fixed-records list. However, if you want to insert a record in its appropriate slot based on the current sort criteria, you can handle the RecordFixedLocationChanged event and call the Record object’s RefreshSortPosition method in the event handler.

The following example code demonstrates how to add fixed records in sorted order.

In XAML:

<igDP:XamDataPresenter
    Name="xamDataPresenter1"
    RecordFixedLocationChanged="OnRecordFixedLocationChanged">
</igDP:XamDataPresenter>

In Visual Basic:

Imports Infragistics.Windows.DataPresenter.Events
...
Private Sub OnRecordFixedLocationChanged(ByVal sender As Object, ByVal e As RecordFixedLocationChangedEventArgs)
    e.Record.RefreshSortPosition()
End Sub
...

In C#:

using Infragistics.Windows.DataPresenter.Events;
...
private void OnRecordFixedLocationChanged(object sender, RecordFixedLocationChangedEventArgs e)
{
    e.Record.RefreshSortPosition();
}
...