1
votes

Some guidance with Silverlight WCF RIA Services... DataGrid and detail view on the same page

Control layout
DataGrid
Detail View [Add New Row (button)]

If I wanted to add a new row from a button then pick that new row in the datagrid how would I do that?

I have tried:

DetailViewTest.Web.Services.Mode1DomainContext ctx = 
       (Mode1DomainContext)wordDomainDataSource.DomainContext;

Word word = new Word()
{
    Word1 = this.word1TextBox.Text,
    DateAdded = DateTime.Now
};
ctx.Words.Add(word);
ctx.SubmitChanges();

This adds the word to that database but not the datagrid even though the datasource for the data is the wordDomainDataSource. If I restart the application it then shows up in the datagrid. Some help with this would be great!

(Using the Silverlight 4 business Application as a starting project )

1
The secret is Word word = new Word() { Word1 = this.word1TextBox.Text, DateAdded = DateTime.Now }; wordDomainDataSource.DataView.Add(word);coder100

1 Answers

0
votes

If you're using the MVVM / INotifyPropertyChanged pattern you probably need to fire the OnPropertyChanged event on the ItemSource.