标签:script mss from source grid private esc efault value
DataGrid myGrid = new DataGrid(); CollectionView myCollectionView = (CollectionView)CollectionViewSource.GetDefaultView(myGrid.Items); ((INotifyCollectionChanged)myCollectionView).CollectionChanged += new NotifyCollectionChangedEventHandler(DataGrid_CollectionChanged);
另一种方式
var dpd = DependencyPropertyDescriptor.FromProperty(ItemsControl.ItemsSourceProperty, typeof(DataGrid)); if (dpd != null) { dpd.AddValueChanged(myGrid, ThisIsCalledWhenPropertyIsChanged); } private void ThisIsCalledWhenPropertyIsChanged(object sender, EventArgs e) {
//搞事 }
标签:script mss from source grid private esc efault value
原文地址:http://www.cnblogs.com/nocanstillbb/p/7999525.html