开发者

Add New Row to a DataGrid in Silverlight WCF RIA Services

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 w开发者_高级运维ith this would be great!

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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜