protected override void OnViewControlsCreated() { base.OnViewControlsCreated(); if (View as ListView == null) { return; } TreeListEditor treeListEditor = (View as ListView).Editor as TreeListEditor; if (treeListEditor != null) { treeList = (ObjectTreeList)treeListEditor.TreeList; Int32 FieldNumber = 0; foreach (RepositoryItem ri in treeList.RepositoryItems) { //if (ri.EditorTypeName == "SingleEdit") { if (FieldNumber == 3) { ri.ReadOnly = false; } FieldNumber++; } treeList.CellValueChanged += new DevExpress.XtraTreeList.CellValueChangedEventHandler(treeList_CellValueChanged); treeList.CellValueChanging += new CellValueChangedEventHandler(treeList_CellValueChanging); //treeList.ShownEditor += treeList_ShownEditor; treeList.OptionsBehavior.Editable = true; treeList.OptionsBehavior.ImmediateEditor = false; } }
void treeListEditor_ControlsCreated(object sender, EventArgs e) { TreeListEditor treeListEditor = (TreeListEditor)sender; UpdateEditableTreeList(treeListEditor); SubscribeToControlEvents(treeListEditor.TreeList); }
public XpandTreeListEditorModelSynchronizerList(TreeListEditor treeListEditor, IModelListView model) : base(treeListEditor, model) { modelSynchronizerList = new ModelSynchronizerList(); modelSynchronizerList.Add(new TreeListOptionsModelSynchronizer(treeListEditor.TreeList, model)); foreach (var modelColumn in model.Columns) { modelSynchronizerList.Add(new TreeListColumnOptionsModelSynchronizer(treeListEditor.TreeList, modelColumn)); } }
protected override void OnViewControlsCreated() { base.OnViewControlsCreated(); TreeListEditor treeListEditor = View.Editor as TreeListEditor; if (treeListEditor != null) { treeList = treeListEditor.TreeList; treeList.OptionsBehavior.EnableFiltering = true; treeList.OptionsFilter.FilterMode = FilterMode.Extended; } }
protected override void OnActivated() { base.OnActivated(); TreeListEditor treeListEditor = View.Editor as TreeListEditor; if (treeListEditor != null) { treeListEditor.AllowEditChanged += treeListEditor_AllowEditChanged; if (treeListEditor.TreeList != null) { UpdateEditableTreeList(treeListEditor); SubscribeToControlEvents(treeListEditor.TreeList); } treeListEditor.ControlsCreated += treeListEditor_ControlsCreated; } }
protected override void OnDeactivated() { TreeListEditor treeListEditor = View.Editor as TreeListEditor; if (treeListEditor != null) { treeListEditor.AllowEditChanged -= treeListEditor_AllowEditChanged; treeListEditor.ControlsCreated -= treeListEditor_ControlsCreated; ObjectTreeList treeList = (ObjectTreeList)treeListEditor.TreeList; if (treeList != null) { treeList.CellValueChanged -= treeList_CellValueChanged; treeList.ShownEditor -= treeList_ShownEditor; } } base.OnDeactivated(); }
private void UpdateEditableTreeList(TreeListEditor treeListEditor) { ObjectTreeList treeList = treeListEditor.TreeList as ObjectTreeList; if (treeList != null) { treeList.OptionsBehavior.Editable = treeListEditor.AllowEdit; foreach (RepositoryItem ri in treeList.RepositoryItems) { ri.ReadOnly = !treeListEditor.AllowEdit; } foreach (TreeListColumnWrapper columnWrapper in treeListEditor.Columns) { IModelColumn modelColumn = View.Model.Columns[columnWrapper.PropertyName]; if (modelColumn != null) { columnWrapper.Column.OptionsColumn.AllowEdit = modelColumn.AllowEdit; } } treeList.OptionsBehavior.ImmediateEditor = true; } }