在WPF中切换DataGrid的绑定源 [英] Switching the Binding Source of DataGrid in WPF
本文介绍了在WPF中切换DataGrid的绑定源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
In my view there is a Datagrid and its itemsourse is binding from Filelist from 3 different folders.
IS it possible to switch the binding source programatically.
Eg:For First click ItemsSource="{Binding FileList}
And for Second Click ItemsSource="{Binding FileList1}
Is it possible in Same Datagrid.?I'm Following MVVM Prism
在此先感谢..
Thanks in advance..
推荐答案
为什么不呢?您只需将System.Windows.Controls.ItemsControl.ItemsSource
分配给FileList
或FileList1
.请参阅 http://msdn.microsoft.com/en-us/library /system.windows.controls.itemscontrol.itemssource.aspx [ ^ ].
—SA
Why not? You just assignSystem.Windows.Controls.ItemsControl.ItemsSource
toFileList
orFileList1
. See http://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol.itemssource.aspx[^].
—SA
这篇关于在WPF中切换DataGrid的绑定源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文