private void EditorShownHandler(object sender, EventArgs e) { ColumnView view; DevExpress.XtraTreeList.TreeList treeList; ViewEditorShownEventArgs vsea = null; if ((view = sender as ColumnView) != null) { vsea = new ViewEditorShownEventArgs { Control = view.ActiveEditor, View = view, FieldName = view.FocusedColumn.FieldName, RepositoryItem = ((BaseEdit)view.ActiveEditor).Properties }; } else if ((treeList = sender as DevExpress.XtraTreeList.TreeList) != null) { vsea = new ViewEditorShownEventArgs { Control = treeList.ActiveEditor, TreeList = treeList, FieldName = treeList.FocusedColumn.FieldName, RepositoryItem = ((BaseEdit)treeList.ActiveEditor).Properties }; } if (vsea != null && _attributesCache.ContainsKey(vsea.FieldName)) { foreach (CustomAttribute a in _attributesCache[vsea.FieldName]) { a.applyCustomEditShown(this, vsea); } } }
private void EditorShownHandler(object sender, EventArgs e) { ColumnView view = (ColumnView)sender; Control editor = view.ActiveEditor; RepositoryItem be = ((BaseEdit)editor).Properties; ViewEditorShownEventArgs vsea = new ViewEditorShownEventArgs { Control = editor, View = view, FieldName = view.FocusedColumn.FieldName, RepositoryItem = be }; if (_attributesCache.ContainsKey(vsea.FieldName)) { foreach (CustomAttribute a in _attributesCache[vsea.FieldName]) { a.applyCustomEditShown(this, vsea); } } }
// grid like container public override void applyCustomEditShown(IDataBindingSource src, ViewEditorShownEventArgs e) { setupRle(src, e.RepositoryItem, e.FieldName); }