private void data_ContentChanged(object sender, EventArgs e) { DevExpress.Xpf.Grid.EditGridCellData data = this.DataContext as DevExpress.Xpf.Grid.EditGridCellData; TreeListNode node = this.treeListView.GetNodeByContent(data.RowData.Row); this.IsExpand = node.IsExpanded; this._CheckItems(data.RowData.Row); }
private void TreeViewExpand_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { DevExpress.Xpf.Grid.EditGridCellData data = this.DataContext as DevExpress.Xpf.Grid.EditGridCellData; if (this.IsExpand) { (data.RowData.View as DevExpress.Xpf.Grid.TreeListView).CollapseNode(data.RowData.RowHandle.Value); this.IsExpand = false; } else { (data.RowData.View as DevExpress.Xpf.Grid.TreeListView).ExpandNode(data.RowData.RowHandle.Value); this.IsExpand = true; } e.Handled = true; }
public override void OnApplyTemplate() { base.OnApplyTemplate(); DevExpress.Xpf.Grid.EditGridCellData data = this.DataContext as DevExpress.Xpf.Grid.EditGridCellData; data.ContentChanged -= new EventHandler(data_ContentChanged); data.ContentChanged += new EventHandler(data_ContentChanged); if (this.treeListView == null) { this.treeListView = data.View as DevExpress.Xpf.Grid.TreeListView; } if (this.treeView == null) { this.treeView = this.treeListView.GetAncestorByType <TreeView>(); } this._CheckItems(data.RowData.Row); }