예제 #1
0
        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);
        }
예제 #2
0
 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;
 }
예제 #3
0
        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);
        }