Beispiel #1
0
 protected GridViewModelSynchronizer(IColumnViewEditor columnViewEditor)
     : base((DevExpress.XtraGrid.Views.Grid.GridView)columnViewEditor.ColumnView, columnViewEditor.Model)
 {
     _columnsListEditor = (ColumnsListEditor)columnViewEditor;
     _columnsListEditor.ControlsCreated += ColumnsListEditorControlsCreated;
     _columnViewEditor = columnViewEditor;
 }
 void ReleaseGridListEditor() {
     if (gridListEditor != null) {
         if (gridListEditor.ColumnView != null) {
             gridListEditor.ColumnView.ShowingEditor -= GridView_ShowingEditor;
             gridListEditor.ColumnView.HiddenEditor -= GridView_HiddenEditor;
         }
         gridListEditor = null;
     }
 }
Beispiel #3
0
        protected ListEditorModelSynchronizer(IColumnViewEditor columnViewEditor)
            : base(columnViewEditor, columnViewEditor.Model)
        {
            var modelListView = (IModelListView)Model;

            ModelSynchronizerList.Add(new FooterVisibleModelSynchronizer(columnViewEditor, modelListView));
            ModelSynchronizerList.Add(new ColumnsListEditorModelSynchronizer((ColumnsListEditor)columnViewEditor, modelListView));
            ((IColumnViewEditor)Control).ColumnView.ColumnPositionChanged += Control_Changed;
        }
 void View_ControlsCreated(object sender, EventArgs e) {
     var listView = (ListView)View;
     ReleaseGridListEditor();
     if (listView.Editor is GridView.GridListEditorBase) {
         gridListEditor = listView.Editor as IColumnViewEditor;
         if (gridListEditor != null) {
             gridListEditor.ColumnView.ShowingEditor += GridView_ShowingEditor;
             gridListEditor.ColumnView.HiddenEditor += GridView_HiddenEditor;
         }
     }
 }
 void ReleaseGridListEditor()
 {
     if (gridListEditor != null)
     {
         if (gridListEditor.ColumnView != null)
         {
             gridListEditor.ColumnView.ShowingEditor -= GridView_ShowingEditor;
             gridListEditor.ColumnView.HiddenEditor  -= GridView_HiddenEditor;
         }
         gridListEditor = null;
     }
 }
        void View_ControlsCreated(object sender, EventArgs e)
        {
            var listView = (ListView)View;

            ReleaseGridListEditor();
            if (listView.Editor is GridView.GridListEditorBase)
            {
                gridListEditor = listView.Editor as IColumnViewEditor;
                if (gridListEditor != null)
                {
                    gridListEditor.ColumnView.ShowingEditor += GridView_ShowingEditor;
                    gridListEditor.ColumnView.HiddenEditor  += GridView_HiddenEditor;
                }
            }
        }
        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;
            }
        }
Beispiel #8
0
 public static bool IsDetailView(this IMasterDetailColumnView columnView, IColumnViewEditor editor) {
     return columnView != editor.Grid.MainView;
 } 
Beispiel #9
0
 public static bool IsDetailView(this IMasterDetailColumnView columnView, IColumnViewEditor editor)
 {
     return(columnView != ((WinColumnsListEditor)editor).Grid.MainView);
 }
Beispiel #10
0
 public static DevExpress.XtraGrid.Views.Grid.GridView GridView(this IColumnViewEditor columnsListEditor)
 {
     return(((ColumnsListEditor)columnsListEditor).GridView());
 }
Beispiel #11
0
 public static bool IsDetailView(this IMasterDetailColumnView columnView, IColumnViewEditor editor) {
     return columnView != ((WinColumnsListEditor) editor).Grid.MainView;
 }