I am using Xamgrid to display results. I would like the results to display sorted by a certain column by default. How do i do this? Many thanks!!
That worked! Thanks Darrell. I am little surprised though with the name of the property. It's sometimes hard to figure out the functionality based on the name. Thanks anyway!
I made a mistake,
FirstSortDirection changes what direction the grid / column will sort the first time you click on an unsorted column.
If you want to sort a column set the IsSorted property on the column.
<ig:XamGrid x:Name="tree" AutoGenerateColumns="false">
<ig:XamGrid.Columns>
<ig:TextColumn Key="FName" HeaderText="blah" IsSorted="Ascending" ></ig:TextColumn>
<ig:TextColumn Key="LName" ></ig:TextColumn>
</ig:XamGrid.Columns>
</ig:XamGrid>
Thanks Darrell for the quick response. I am able to sort by a certain column by setting this property. But, it seems the grid is also getting sorted by another column that doesn't have this property. For example, i have two columns rank and source. I am setting the FirstSort property of rank to ascending. The results are displayed as multi sorted first by Rank and then by Source automatically. Should i set any other property of the grid to fix this? Many thanks!!
You should be able to set the FirstSortDirection property of the Column
http://help.infragistics.com/NetAdvantage/Silverlight/2010.2/CLR4.0/?page=InfragisticsSL4.Controls.Grids.XamGrid.v10.2~Infragistics.Controls.Grids.Column~FirstSortDirection.html