I'm new to both Silverlight and RIA. I have a simple form with a DataGrid bound to a DomainDataSource object. The rows displayed represent section headings to be displayed on a webpage. One of the columns is called OrdinalPosition and I have specified that the grid is to sort by this column. I have a custom column with up and down arrow buttons. The desired behavior is that when the user clicks the up/down buttons the OrdinalPosition is incremented/decremented so that they can specify what order the sections appear in.
If I manually change the value in the OrdinalPosition column, as soon as I move off the row the grid reorders itself. However, if I use code-behind to change the value the grid does not reorder itself (even though the grid does display the new value.) Here is my codebehind for the button click...
private void incrementOrdinal(object sender, System.Windows.RoutedEventArgs e)
{
Button btn = (Button)sender;
Section s = (Section)sectionDataGrid.SelectedItem;
s.Ordinal++;
sectionDataGrid.CommitEdit();
}
Is there something I should be doing to cue the grid to reorder its records?