Esempio n. 1
0
        public void reinitTreeFromView(CswNbtView View, CswNbtViewNode ViewNodeToSelect, CswNbtViewNode DefaultNodeToSelect, ViewTreeSelectType SelectType)
        {
            EnsureChildControls();

            // Setup tree and selected node
            string PriorSelectedNodeValue = string.Empty;

            if (_Tree.SelectedNode != null)
            {
                PriorSelectedNodeValue = _Tree.SelectedNode.Value;
            }

            _Tree.Nodes.Clear();
            _initTreeFromViewRecursive(View.Root, _Tree.Nodes, SelectType);

            if (PriorSelectedNodeValue != string.Empty)
            {
                RadTreeNode PotentialNodeMatch = _Tree.FindNodeByValue(PriorSelectedNodeValue);
                if (PotentialNodeMatch != null)
                {
                    PotentialNodeMatch.Selected = true;
                }
            }
            if (ViewNodeToSelect != null)
            {
                RadTreeNode PotentialNodeMatch = _Tree.FindNodeByValue(ViewNodeToSelect.ArbitraryId);
                if (PotentialNodeMatch != null)
                {
                    PotentialNodeMatch.Selected = true;
                }
            }
            if (_Tree.SelectedNode == null && DefaultNodeToSelect != null)
            {
                _Tree.FindNodeByValue(DefaultNodeToSelect.ArbitraryId).Selected = true;
            }

            if (_Tree.SelectedNode == null && IsRootSelectable)
            {
                _Tree.FindNodeByValue(View.Root.ArbitraryId).Selected = true;
            }

            _Tree.ExpandAllNodes();
        }
Esempio n. 2
0
    protected void CargarNodosRaiz()
    {
        RadTreeView rdt1 = (RadTreeView)RadPanelBar1.Items[0].FindControl("RadTreeView1");

        rdt1.Nodes.Clear(); // limpia todos los nodos
        RadTreeNode node = new RadTreeNode("Empresas");

        node.Value    = "Empresas";
        node.Category = "Empresas";
        node.ImageUrl = "imagenes/office-building_16.png";
        //CargarEmpresas(node);
        rdt1.Nodes.Add(node);
        node          = new RadTreeNode("Categorias");
        node.Value    = "Categorias";
        node.Category = "Categorias";
        node.ImageUrl = "imagenes/folder_cubes_16.png";
        //CargarCategorias(node);
        rdt1.Nodes.Add(node);
        rdt1.ExpandAllNodes();
    }