Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
210
Problems sorting column in XamGrid
posted

Greetings

I have a xamgrid in which I would like to always have the last column sorted in descending order.  the data changes quite frequently but I want those changes to be reflected in the grid when they do change.  How do I make it so that the last column is always sorted?  I thought I needed to use the issorted property but it looks like not.

<ig:XamGrid x:Name="SideGrid"
Grid.Row="2"
Grid.ColumnSpan="2"
ItemsSource="{Binding}"
AutoGenerateColumns="False"
>
<ig:XamGrid.Columns>
<!--<ig:TextColumn HeaderText="Bus Rank"/>-->
<ig:TextColumn HeaderText="Number" Key="Number" Width="90" IsSortable="False"/>
<ig:TextColumn HeaderText="Load" Key="Load" Width="*" IsSorted="Descending"/>
</ig:XamGrid.Columns>
<ig:XamGrid.SortingSettings>
<ig:SortingSettings ShowSortIndicator="False"/>
</ig:XamGrid.SortingSettings>

Parents
  • 17475
    Offline posted

    Hello Matthew, 

    Thank you for posting! 

    I made a sample project where I set the IsSorted property of the TextColumn to Descending. When new record is added using the AddNewRecord functionality or new data item is added to the source collection using the top button, a row is added in the correct position respecting the sorting of the ProductID column. Could you try to run the attached project and let me know if it works as expected on your side? Do the data changes take effect on the grid so that new rows are added when you run your project? If not, you might want to check whether the xamGrid is notified for these changes by implementing INotifyPropertyChage interface.

    XamGridSorting.zip
Reply Children