Beispiel #1
0
 private void ExpandNode(string nodeId)
 {
     Infragistics.WebUI.UltraWebNavigator.Node n = Utils.FindNodeInTree(webTree.Nodes, nodeId);
     if (n != null && !n.Expanded)
     {
         using (dbObj = Utils.GetMainDB())
         {
             // Retrieve all children
             DataSet ds = dbObj.RunSPReturnDataSet("dbo._User_ScopeGetTV", "Items",
                                                   new SqlParameter("@UserId", -1),
                                                   new SqlParameter("@ParentId", nodeId));
             n.DataBind(ds.Tables[0].DefaultView, "Items");
             dbObj.CloseConnection();
         }
         n.Expanded = true;
     }
 }
 private void ExpandNode(string nodeId)
 {
     Infragistics.WebUI.UltraWebNavigator.Node n = Utils.FindNodeInTree(webTree.Nodes, nodeId);
     if (n != null)
     {
         using (dbObj = Utils.GetMainDB())
         {
             using (DataSet ds = dbObj.RunSPReturnDataSet("dbo._LinkType_GetTv", "Items",
                                                          new SqlParameter("@LinkTypeId", linkTypeId),
                                                          new SqlParameter("@ParentId", nodeId),
                                                          new SqlParameter("@LinkFromTo", Convert.ToByte(!linkFrom)),
                                                          new SqlParameter("@Company", SessionState.CompanyName)))
             {
                 dbObj.CloseConnection();
                 n.DataBind(ds.Tables[0].DefaultView, "Items");
                 ds.Dispose();
                 n.Expanded = true;
             }
         }
     }
 }