更新时间:2023-10-04 14:39:58
在WPF中执行此操作的***方法是使数据源成为可观察的集合.然后,您可以将项目添加到集合中,并且网格将更新.当然,如果您拥有全部的SQL,则应将其添加到数据库中并刷新数据源.
The best way to do this in WPF is to make the data source an observable collection. Then you can add items to the collection and the grid will update. Of course, if you have SQL behind it all, you should add the item to the DB and refresh the data source.