void SyncronizeDataSourceWithCriteria(IColumnViewEditor columnViewEditor) { var detailColumnView = (IMasterDetailColumnView)(columnViewEditor).ColumnView.GridControl.FocusedView; if (detailColumnView.IsDetailView(columnViewEditor)) { EventHandler[] eventHandlers = { null }; eventHandlers[0] = (sender, args) => { var dataSource = ((IColumnViewEditor)View.Editor).ColumnView.DataSource; ObjectSpace.ApplyCriteria(dataSource, View.CollectionSource.GetCriteria()); ((IColumnViewEditor)View.Editor).ColumnView.DataSourceChanged -= eventHandlers[0]; }; ((IColumnViewEditor)View.Editor).ColumnView.DataSourceChanged += eventHandlers[0]; View.CollectionSource.CriteriaApplied += CollectionSourceOnCriteriaApplied; } }
void CollectionSourceOnCriteriaApplied(object sender, EventArgs eventArgs) { var dataSource = ((IColumnViewEditor)View.Editor).ColumnView.DataSource; ObjectSpace.ApplyCriteria(dataSource, View.CollectionSource.GetCriteria()); }