开发者

DataGrid view refreshing from database

Hy! I created a view to populate my datagrid,开发者_运维知识库 and I want to update this view and my datagrid. The problem is that in my database the view is refresing but in my form i dont see the changes.

this.dataGrid.ItemsSource = dataSource.My_View;

My_View.Name = Andy;

My_View.Age = 14;

dataSource.SaveChanges();

dataGrid.Items.Refresh();

but I do not see this new row in my datagrid, but in database I see this new row.

Can someone help me?

Thanks!


Why not just bind after the update?

    My_View.Name = Andy; 
    My_View.Age = 14; 
    dataSource.SaveChanges(); 
    this.dataGrid.ItemsSource = dataSource.My_View;  
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜