However, when I click into a cell in the StepOrder column and change the value so that it would change the order of the rows in the sort, I get a reference not set to an instance of an object error thrown.
How can I keep the grid sorted by StepOrder (assuming the user doesn't click the column headers to resort) and make sure they can safely edit the StepOrder values?
In GridSteps_CellEditEnded, I just call ddsSteps.SubmitChanges();
Here is my XAML:
<ria:DomainDataSource x:Name="ddsSteps" QueryName="GetSteps" AutoLoad="False">
<ria:DomainDataSource.DomainContext>
<ds:EngineeringContext/>
</ria:DomainDataSource.DomainContext>
<ria:DomainDataSource.SortDescriptors>
<ria:SortDescriptor Direction="Ascending" PropertyPath="StepOrder" />
</ria:DomainDataSource.SortDescriptors>
</ria:DomainDataSource>
<datagrid:RadGridView x:Name="GridSteps" IsReadOnly="False" CellEditEnded="GridSteps_CellEditEnded" ItemsSource="{Binding Data, ElementName=ddsSteps}" dragDrop:RadDragAndDropManager.AllowDrop="True" AutoGenerateColumns="False" IsFilteringAllowed="False" CanUserFreezeColumns="False" CanUserInsertRows="False" ShowGroupPanel="False">
<datagrid:RadGridView.Columns>
<datagrid:GridViewDataColumn Header="Step Description" DataMemberBinding="{Binding StepDesc}" Width="250"/>
<datagrid:GridViewDataColumn Header="Order" DataMemberBinding="{Binding StepOrder}" Width="50"/>
</datagrid:RadGridView.Columns>
<
/datagrid:RadGridView>