/// <summary> /// Reloads data. /// </summary> public override void ReloadData() { if (!StopProcessing && (ProviderObject != null)) { TreeView.Nodes.Clear(); TreeView.EnableViewState = false; // Add custom root node if (CustomRootNode != null) { if (!EnableRootAction) { CustomRootNode.SelectAction = TreeNodeSelectAction.None; } TreeView.Nodes.Add(CustomRootNode); RaiseOnPopulateRootNode(); } else { if (MultipleRoots) { // Load all roots DataSet ds = ProviderObject.LoadData(ProviderObject.ParentIDColumn + " IS NULL"); if (!DataHelper.DataSourceIsEmpty(ds)) { foreach (DataRow dr in ds.Tables[0].Rows) { // Add all results as roots UniTreeNode rootNode = new UniTreeNode(ProviderObject, ""); rootNode.ItemData = dr; TreeView.Nodes.Add(CreateNode(rootNode)); } } } else // Add root node from provider if (ProviderObject.RootNode != null) { mRootNode = CreateNode((UniTreeNode)ProviderObject.RootNode); RaiseOnNodeCreated((UniTreeNode)ProviderObject.RootNode, ref mRootNode); mRootNode.Expanded = true; TreeView.Nodes.Add(mRootNode); } } } }