tags:

views:

324

answers:

1

I have a data grid that groups on a TypeId. When ever data is enetered into the fileds it wants to sort the data in the Grouped area. I cannot seem to turn that feature off.

A: 

Are You asking about AllowSorting property of DataGrid ? Just set it at false and nobody can sort in dataGrid.

or Create column and set in it disable sorting like that

 <dg:DataGrid ItemsSource="{StaticResource myData}"/> >
<dg:DataGrid.Columns>
    <dg:DataGridTextColumn Header="No." Width="SizeToCells"  
                                       Binding="{Binding CheckNumber}" 
                                       IsReadOnly="True"/>
    <dg:DataGridTextColumn Header="Date" 
                                       Binding="{Binding Date, StringFormat=d}" />
    <dg:DataGridTextColumn Header="Pay To" MinWidth="200" 
                                       Binding="{Binding Recipient}"
                                       CanUserSort="False"/>
</dg:DataGrid.Columns>
</dg:DataGrid>
netmajor