Hi ,
I have a XamDataGrid(WPF Infragestic control) which is bound an observable collection.this observable collection is getting data from datbase.
The working of XamDataGridis like this.
1) If no data from the database is returned (or intial opening of the window) the gridview will display 10 emty rows
2) If data is loaded data should be bound to the grid + the empty rowsfor example if 2 rows of data returned 2 rows + 8 empty rows.
For this requirement i have bound empty objects to the collection to display empty rows.
And when data is returned these empty rows are removed and replaced by the actual objects.
So the other rows remains empty.
All goes fine but it fails when i do sorting on the grid.If i click on sort of XamDataGrid the empty rows(empty objects) also get sorted.
It appers like this
Empty Row
Empty Row Empty Row
Data1----row
Data2----row
Data3-----row
Actually my requirement is, I need the empty rows to be displayed always below the datarows.
Please advise .
**Note**:(ASAP...)
SNA
It depends on your custom logic:
public class MyComparer : IComparer
{
#region IComparer Members
int IComparer.Compare(object x, object y)
throw new NotImplementedException();
}
#endregion
Thanks .
Do you have any example of a custom comparer ?
Hello,
By default, the XamDataGrid will sort the data according to its datatype and if you compare strings, you will get this result - it is expected. If you want to change this, you can create a class that implements IComparer and set the SortComparer property of the FieldSettings.
Hope this helps.