dataGrid wpf应用程序 [英] dataGrid wpf application
本文介绍了dataGrid wpf应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在wpf应用程序dataGrid1.ItemsSource = ds.DefaultView中填充dataGrid;但是我想从此datagrid中删除数据,然后再次填充datagrid,任何一种方法都可以帮助我
i fill dataGrid in wpf application dataGrid1.ItemsSource = ds.DefaultView; but i want to remove data from this datagrid and again fill datagrid any oan can help me
推荐答案
Datagrid,然后从另一个数据集中加载数据?
如果是这样,类似:
Do you mean that you''re trying to clear the items in the Datagrid and then load the data from another dataset?
If that''s the case, something like:
if(datagrid.itemsource != null)
datagrid.itemsource = null;
然后像上面已经做的那样提供一个新的数据源:
dataGrid1.ItemsSource = ds.DefaultView;
and then provide a new datasource like you''re already doing above:
dataGrid1.ItemsSource = ds.DefaultView;
这篇关于dataGrid wpf应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文