Example #1
0
        protected void SelectTree(ASPxTreeList treelist, DataTable dtSel)
        {
            TreeListNodeIterator iterator = treelist.CreateNodeIterator();
            TreeListNode         node;

            for (int i = 0; i < dtSel.Rows.Count; i++)
            {
                while (true)
                {
                    node = iterator.GetNext();
                    if (node == null)
                    {
                        break;
                    }

                    if ((Convert.ToInt32(dtSel.Rows[i]["ID"]) == Convert.ToInt32(node.GetValue("ID"))))
                    {
                        //5/8/2014 NS modified
                        if (node.ParentNode.Key != "" || !node.HasChildren)
                        {
                            node.Selected = true;
                        }
                    }
                }
                iterator.Reset();
            }
        }
Example #2
0
        protected void SetNodeSelectionSettings(ASPxTreeList treeList)
        {
            TreeListNodeIterator iterator = treeList.CreateNodeIterator();
            TreeListNode         node;

            while (true)
            {
                node = iterator.GetNext();
                if (node == null)
                {
                    break;
                }
            }
        }
Example #3
0
        private DataTable GetSelectedMenu(ASPxTreeList treelist)
        {
            DataTable dtSel = new DataTable();

            try
            {
                dtSel.Columns.Add("Name");


                TreeListNodeIterator iterator = treelist.CreateNodeIterator();
                TreeListNode         node;

                TreeListColumn columnId = treelist.Columns["Name"];

                while (true)
                {
                    node = iterator.GetNext();

                    if (node == null)
                    {
                        break;
                    }
                    if (node.Selected)
                    {
                        DataRow dr = dtSel.NewRow();

                        dr["Name"] = node.GetValue("Name");
                        dtSel.Rows.Add(dr);
                    }
                }
            }
            catch (Exception ex)
            {
                //Log.Entry.Ins.Write(Server.MapPath("~/LogFiles/"), "VSPlusLog.txt", DateTime.Now.ToString() + " Error in Page: " +
                //    Request.Url.AbsolutePath + ", Method: " + System.Reflection.MethodBase.GetCurrentMethod().Name +
                //    ", Error: " + ex.ToString());
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                throw ex;
            }

            return(dtSel);
        }
Example #4
0
        protected void SelectTree(ASPxTreeList treelist, DataTable dtSel)
        {
            TreeListNodeIterator iterator = treelist.CreateNodeIterator();
            TreeListNode         node;

            for (int i = 0; i < dtSel.Rows.Count; i++)
            {
                while (true)
                {
                    node = iterator.GetNext();
                    if (node == null)
                    {
                        break;
                    }

                    if (dtSel.Rows[i]["Name"].ToString() == node.GetValue("Name").ToString())
                    {
                        node.Selected = true;
                    }
                }
                iterator.Reset();
            }
        }
Example #5
0
        private DataTable GetSelectedMenu(ASPxTreeList treelist)
        {
            DataTable dtSel = new DataTable();

            //5/8/2014 NS added
            DataColumn[] keys = new DataColumn[1];
            DataColumn   column;

            try
            {
                dtSel.Columns.Add("ID");
                //5/8/2014 NS added
                column           = dtSel.Columns["ID"];
                keys[0]          = column;
                dtSel.PrimaryKey = keys;

                TreeListNodeIterator iterator = treelist.CreateNodeIterator();
                TreeListNode         node;
                //5/8/2014 NS added
                TreeListNode parent;
                DataRow      founddr;

                TreeListColumn columnId = treelist.Columns["ID"];

                while (true)
                {
                    node = iterator.GetNext();

                    if (node == null)
                    {
                        break;
                    }
                    if (node.Selected)
                    {
                        DataRow dr = dtSel.NewRow();

                        dr["ID"] = node.GetValue("ID");
                        dtSel.Rows.Add(dr);
                        //5/8/2014 NS added
                        parent = node.ParentNode;
                        if (parent != null)
                        {
                            if (parent.Key.ToString() != "")
                            {
                                founddr = dtSel.Rows.Find(parent.GetValue("ID"));
                                if (founddr == null)
                                {
                                    dr       = dtSel.NewRow();
                                    dr["ID"] = parent.GetValue("ID");
                                    dtSel.Rows.Add(dr);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                //Log.Entry.Ins.Write(Server.MapPath("~/LogFiles/"), "VSPlusLog.txt", DateTime.Now.ToString() + " Error in Page: " +
                //    Request.Url.AbsolutePath + ", Method: " + System.Reflection.MethodBase.GetCurrentMethod().Name +
                //    ", Error: " + ex.ToString());
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                throw ex;
            }

            return(dtSel);
        }