Click here to Skip to main content
15,907,329 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Vertical Method Pin
Shameel29-Feb-12 16:45
professionalShameel29-Feb-12 16:45 
QuestionNeed to create Treeview by arraylist Pin
Member 322226429-Feb-12 2:10
Member 322226429-Feb-12 2:10 
AnswerRe: Need to create Treeview by arraylist Pin
Andy41129-Feb-12 2:40
Andy41129-Feb-12 2:40 
GeneralRe: Need to create Treeview by arraylist Pin
Member 322226429-Feb-12 2:52
Member 322226429-Feb-12 2:52 
AnswerREPOST Pin
Not Active29-Feb-12 3:31
mentorNot Active29-Feb-12 3:31 
QuestionTreeView from Arraylist Pin
Member 322226429-Feb-12 2:08
Member 322226429-Feb-12 2:08 
AnswerREPOST Pin
Not Active29-Feb-12 3:33
mentorNot Active29-Feb-12 3:33 
QuestionTree View created from arraylist Pin
Member 322226428-Feb-12 23:03
Member 322226428-Feb-12 23:03 
Hi,
I had created treeview using Arraylist as per the below code.
C#
using System;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.Collections;
using IHCISCore.Core.Entities;
using IHCISCore.Core.Pages;
using IHCIS.Common.Entities;
using System.Web.SessionState;
using System.Data;
using System.Web;
using IHCISCore.Core.Controls;
using IHCISCore.Core;

namespace IHCISCore.Core.Controls
{
    /// <summary>
    /// Summary description for TreeView.
    /// </summary>
    public class TreeView : LiteralControl
    {


        private ArrayList Checked;
        private ArrayList TreeList = null;
        /*
            Start Code Change
            Project: ImpactPro5.0
            CR - 
            Author: Sandeep Hegde
            Date: 29/Oct/2007
            Comments: HRA tab loading
        */
        public ArrayList txtval;
        public ArrayList txtchildval;
        public ArrayList hiddenTreeNamesA; // Added by jeelani
        public ArrayList hiddenTreeExPA;
        public ArrayList hiddenTreeExCA;
        public ArrayList hiddenTreeExAdvPA;
        public ArrayList hiddenTreeExAdvCA;
        public ArrayList hiddenTreeInAdvPA;
        public ArrayList hiddenTreeInAdvCA;

        public ArrayList hiddenTreeInPMinA;
        public ArrayList hiddenTreeInCMinA;
        public ArrayList hiddenTreeExPMinA;
        public ArrayList hiddenTreeExCMinA;

        public ArrayList hiddenTreeInAdvPMinA;
        public ArrayList hiddenTreeInAdvCMinA;
        public ArrayList hiddenTreeExAdvPMinA;
        public ArrayList hiddenTreeExAdvCMinA;

        // End changes - jeelani

        //End of code change

        public TreeView()
        {
            Checked = new ArrayList();
        }

        public TreeView(string id)
            : this()
        {
            ID = id;
        }

        public TreeView(string id, ArrayList treeList)
            : this(id)
        {
            TreeList = treeList;
        }

                   foreach (Node folder in tree)
                {

                    //ADDED BU GUHAN
                    initScript += ID + ".AddFolder('" + "RETRO" + "',"
                        + (folder.isSystem ? "false" : "true") + ")\n";

                    //END OF CODE






                    //initScript += ID + ".AddFolder('" + folder.Title +"',"
                    //    + (folder.isSystem ? "false" : "true") + ")\n";
                    foreach (Node node in folder.Children)
                    {
                        if (node.Children.Count >= 1 && !node.HideChildren) // Assume it's Lab Test node
                        {
                            //Changed to refer the string property (LOINCID) 
                            if (ID.Substring(0, 3) == "Lab")
                                initScript += ID + ".AddLabTestFolder('" + node.Title
                                    + "', '" + node.LOINCID + "', '"
                                    + LabResults(node.LOINCID.ToString())
                                    + "','" + ((Node)node.Children[0]).Title + "')\n";

                            string tabName = ID.Substring(0, 3);

                            if (tabName == "Cln" || tabName == "Hra")
                            {
                                //coded by guhan feb 27th 2012
                                // initScript += ID + ".AddLevel3Folder('" + node.CategoryName + "')\n";

                                initScript += ID + ".AddFolder('" + node.CategoryName + "',"
                            + (folder.isSystem ? "false" : "true") + ")\n";

                                //foreach (Node level4 in node.Children)
                                //    initScript += ID + ".AddNodeL3('" + level4.CategoryName
                                //        + "', '" + level4.ID + "', "
                                //        + Checked.Contains(level4.ID.ToString()).ToString().ToLower()
                                //        + ")\n";
                                //end of code


                                initScript += ID + ".AddLevel2Folder('" + node.Title + "')\n";
                                foreach (Node level3 in node.Children)
                                    initScript += ID + ".AddNodeL3('" + level3.Title
                                        + "', '" + level3.ID + "', "
                                        + Checked.Contains(level3.ID.ToString()).ToString().ToLower()
                                        + ")\n";
                            }

                            if (tabName == "Qua")
                            {
                                initScript += ID + ".AddLevel2Folder('" + node.Title + "')\n";
                                foreach (Node level3 in node.Children)
                                    initScript += ID + ".AddNodeL3('" + level3.Title
                                        + "', '" + level3.CONDITIONID + "', "
                                        + Checked.Contains(level3.CONDITIONID.ToString()).ToString().ToLower()
                                        + ")\n";
                            }

                        }
                        else
                            initScript += ID + ".AddNode('" + node.Title
                                + "', '" + node.ID + "', "
                                + Checked.Contains(node.ID.ToString()).ToString().ToLower()
                                + ")\n";
                    }
                }
            }
            initScript += "ShowTree(" + ID + ")\n</script>";
            Page.ClientScript.RegisterStartupScript(typeof(Page), ID, initScript);
        }

        private string LabResults(string LabID)
        {
            string result = "";
            foreach (string id in Checked)
                if (id.StartsWith(LabID + ":") || id.StartsWith(LabID + "|"))
                    result += id.Substring(LabID.Length) + ",";
            if (result.Length > 0)
                result = "," + result;
            return result;
        }
    }


As seen below is the screenshot

+ RETRO
|
|
|UNAMED FOLDER CREATED
|
|ALL CANCER FOLDER
|
|___BONE AND MARROW
|
|___CANCER AND ALL

I need to add the empty folder to RETRO folder.
I need to add UNAMED FOLDER to RETRO FOLDERHow to add it.
Here initScript is the script for javascript.

Thanks
S.GuhananthTO

modified 29-Feb-12 7:39am.

AnswerRe: Tree View created from arraylist Pin
Not Active29-Feb-12 1:03
mentorNot Active29-Feb-12 1:03 
GeneralRe: Tree View created from arraylist Pin
Member 322226429-Feb-12 1:41
Member 322226429-Feb-12 1:41 
GeneralRe: Tree View created from arraylist Pin
Not Active29-Feb-12 1:52
mentorNot Active29-Feb-12 1:52 
GeneralRe: Tree View created from arraylist Pin
Member 322226429-Feb-12 2:23
Member 322226429-Feb-12 2:23 
GeneralRe: Tree View created from arraylist Pin
Not Active29-Feb-12 3:30
mentorNot Active29-Feb-12 3:30 
Questionmessage box with YES/NO button Pin
C#_Programmer28-Feb-12 22:31
C#_Programmer28-Feb-12 22:31 
AnswerRe: message box with YES/NO button Pin
Richard MacCutchan28-Feb-12 22:39
mveRichard MacCutchan28-Feb-12 22:39 
AnswerRe: message box with YES/NO button Pin
Not Active29-Feb-12 1:06
mentorNot Active29-Feb-12 1:06 
QuestionLimiting Users Download Size Pin
Majid Shahabfar28-Feb-12 21:16
Majid Shahabfar28-Feb-12 21:16 
AnswerRe: Limiting Users Download Size Pin
Not Active29-Feb-12 1:09
mentorNot Active29-Feb-12 1:09 
Questionhow to clear textbox when page is refreshed asp.net c# Pin
crisjala28-Feb-12 20:00
crisjala28-Feb-12 20:00 
AnswerRe: how to clear textbox when page is refreshed asp.net c# Pin
Abhinav S28-Feb-12 22:09
Abhinav S28-Feb-12 22:09 
QuestionTest Cases for web.config encryption Pin
Jaison Peter28-Feb-12 17:44
Jaison Peter28-Feb-12 17:44 
QuestionReading Values from XML optional node in huge xml file Pin
yvrmurari28-Feb-12 12:14
yvrmurari28-Feb-12 12:14 
QuestionHi pls help me to do this? Pin
LekshmiM27-Feb-12 22:16
LekshmiM27-Feb-12 22:16 
AnswerRe: Hi pls help me to do this? Pin
Richard MacCutchan27-Feb-12 22:46
mveRichard MacCutchan27-Feb-12 22:46 
AnswerRe: Hi pls help me to do this? Pin
Abhinav S27-Feb-12 23:55
Abhinav S27-Feb-12 23:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.