Exemplo n.º 1
0
        private void treeList1_FilterNode(object sender, DevExpress.XtraTreeList.FilterNodeEventArgs e)
        {
            string NodeText  = e.Node["CountryName"].ToString();
            bool   IsVisible = NodeText == "中国";

            if (IsVisible)
            {
                DevExpress.XtraTreeList.Nodes.TreeListNode Node = e.Node.ParentNode;
                while (Node != null)
                {
                    if (!Node.Visible)
                    {
                        Node.Visible = true;
                        Node         = Node.ParentNode;
                    }
                    else
                    {
                        break;
                    }
                }
            }

            e.Node.Visible = IsVisible;
            e.Handled      = true;
        }
Exemplo n.º 2
0
        private void popTree_FilterNode(object sender, DevExpress.XtraTreeList.FilterNodeEventArgs e)
        {
            string _key       = string.Format("{0}", e.Node[_DropDisplayName]).ToUpper();
            string _filterTxt = this.Text.ToUpper();
            bool   _isVisible = _filterTxt.Length > 2 ? _key.Contains(_filterTxt) : _key.StartsWith(_filterTxt);

            if (this.popTree.Selection.Count == 0 ||
                this.popTree.Selection[0].ParentNode == null ||
                this.popTree.Selection[0].ParentNode != e.Node)
            {
                e.Node.Visible = _isVisible;//父项设置不可见后,子项被选中项会被取消
            }
            if (_isVisible)
            {
                ExpandedParentNode(e.Node);
            }
            //if (e.Node.ParentNode != null)
            //{
            //  if (_isVisible &&
            //    (!e.Node.ParentNode.Visible || !e.Node.ParentNode.Expanded))
            //  {
            //    e.Node.ParentNode.Expanded =
            //    e.Node.ParentNode.Visible = true;
            //  }
            //}
            e.Handled = true;
        }
Exemplo n.º 3
0
 private void OnFilterNode(object sender, DevExpress.XtraTreeList.FilterNodeEventArgs e)
 {
     //List<TreeListColumn> filteredColumns = e.Node.TreeList.Columns.Cast<TreeListColumn>().ToList();
     //if (filteredColumns.Count == 0) return;
     if (string.IsNullOrEmpty(getValue(treeListLookUpViTriTreeList.FilterPanelText)))
     {
         return;
     }
     e.Handled = true;
     //e.Node.Visible = filteredColumns.Any(c => IsNodeMatchFilter(e.Node, c));
     e.Node.Visible  = IsNodeMatchFilter(e.Node, colten);
     e.Node.Expanded = e.Node.Visible;
 }
Exemplo n.º 4
0
        private void OnFilterNode(object sender, DevExpress.XtraTreeList.FilterNodeEventArgs e)
        {
            List <DevExpress.XtraTreeList.Columns.TreeListColumn> filteredColumns = e.Node.TreeList.Columns.Cast <DevExpress.XtraTreeList.Columns.TreeListColumn>(
                ).ToList();

            if (filteredColumns.Count == 0)
            {
                return;
            }
            if (string.IsNullOrEmpty(treeListLoaiTB.FindFilterText))
            {
                return;
            }
            e.Handled       = true;
            e.Node.Visible  = filteredColumns.Any(c => IsNodeMatchFilter(e.Node, c));
            e.Node.Expanded = e.Node.Visible;
        }