开发者

Auto Update DataGrid after data insert/delete

开发者 https://www.devze.com 2023-04-01 16:39 出处:网络
I\'m using LINQ to entities to insert and delete data from a DataGrid that is 开发者_如何学运维displayed on the homepage of my WPF application. I was wondering if there was a way or a DataGrid feature

I'm using LINQ to entities to insert and delete data from a DataGrid that is 开发者_如何学运维displayed on the homepage of my WPF application. I was wondering if there was a way or a DataGrid feature that would make my DataGrid auto-update and show changes upon insert/delete by itself rather than me having to re-execute the LINQ query that fills the datagrid (which is how i am achieving this now).

Thanks in advance.


Yes, bind your datagrid to an ObservableCollection<T>, or even better, to an Asynchronous Multi-threaded ObservableCollection...

0

精彩评论

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