2014-06-16 51 views
0

我的數據網格在我的WPF解決方案中,其數據源是ICollectionView。但在onclick中,我想查找數據源的System.type。我怎樣才能找到ICollectionView數據源獲得ICollectionView數據類型

回答

0

的元素類型你可以這樣做

(this.yourGridName.ItemsSource as ICollectionView).SourceCollection.AsQueryable().ElementType == typeof(your_system_type) 
+0

由於它的工作.. – user3706084