Click here to Skip to main content
15,889,216 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Viewstate vs Rereading XMLDocument Pin
Paulo Zemek14-Dec-09 10:08
mvaPaulo Zemek14-Dec-09 10:08 
GeneralRe: Viewstate vs Rereading XMLDocument Pin
KittyKit21-Dec-09 22:44
KittyKit21-Dec-09 22:44 
GeneralRe: Viewstate vs Rereading XMLDocument Pin
Paulo Zemek22-Dec-09 6:49
mvaPaulo Zemek22-Dec-09 6:49 
QuestionHow to find first index value in a string is character or numeric Pin
Satish - Developer10-Dec-09 22:28
Satish - Developer10-Dec-09 22:28 
AnswerRe: How to find first index value in a string is character or numeric Pin
Petr Pechovic10-Dec-09 22:39
professionalPetr Pechovic10-Dec-09 22:39 
AnswerRe: How to find first index value in a string is character or numeric Pin
Covean10-Dec-09 22:55
Covean10-Dec-09 22:55 
GeneralRe: How to find first index value in a string is character or numeric Pin
Covean10-Dec-09 23:56
Covean10-Dec-09 23:56 
QuestionTreeview Dynamic Display in ASP.NET Pin
Vimalsoft(Pty) Ltd10-Dec-09 21:57
professionalVimalsoft(Pty) Ltd10-Dec-09 21:57 
Good Day

I have posted this question before , i cant find it to continue from it. Let me start from Scratch because i did not find a Solution to this problem.

in my page am using a Treeview Control show like this

http://www.vuyiswamaseko.com/public/Wrong_Display.JPG[^]

and am loading data in SQL like this

http://www.vuyiswamaseko.com/public/Query_Wrong_Display.JPG[^]

and my code behind for loading the control looks like this

public void PopulateTreeFromCurr(int currID)
    {    
        // CurrStructDataSource calls sp_Traverse_Tree which returns an inordered list of nodes for a tree
        IEnumerable result = CurrStructDataSource.Select(DataSourceSelectArguments.Empty);
        // ID, Parent, Child, Description, Level, i
        int Parent, Child;
        CurriculumTreeView.Nodes.Clear();
        
        ArrayList CurrNodes = new ArrayList();

        if (result != null)
        {
            // an ordered set of nodes is given. parent always before current node except for root            
            foreach (System.Data.DataRowView row in result)
            {
                TreeNode newnode = new TreeNode(row["Description"].ToString(), row["NodeID"].ToString());
                CurrNodes.Add(newnode); // should setup a lookup between the id given by the ArrayList and that of the node
                // as we add the nodes, we can set up the hierarchy
                if (row["refParent"].ToString() == "")
                {   // don't have to add the root node to another node-it is the root
                }
                else
                {
                    Parent = Convert.ToInt32(row["refParent"]);
                    Child = Convert.ToInt32(row["ID"]);

                    TreeNode ParentNode = new TreeNode();
                    TreeNode ChildNode = new TreeNode();

                    ParentNode = (TreeNode)CurrNodes[Parent];
                    ChildNode = (TreeNode)CurrNodes[Child];
                    ParentNode.ChildNodes.Add(ChildNode);
                    CurrNodes[Parent] = ParentNode;
                }
            }
            if (CurrNodes.Count > 0)
            {
                // Add the first root compulsory which has all nodes attached to it
                CurriculumTreeView.Nodes.Add((TreeNode)CurrNodes[0]);
                CurriculumTreeView.ExpandAll();
            }
        }
    }

This above will show me results in this Manner in my application

http://www.vuyiswamaseko.com/public/Wrong_Display.JPG[^]

but now i want the Display to be like this

http://www.vuyiswamaseko.com/public/Correct_Display.JPG[^]


and i have changed my Query so that it gives me the Correct results from the SQL and i changed it to this

http://www.vuyiswamaseko.com/public/Query_Right_Display.JPG[^]

and the above Results in SQl they are Correct , but now when i run it, in the Application i get an Error

http://www.vuyiswamaseko.com/public/Received_Error.JPG[^]

Thanks

Vuyiswa Maseko,

Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.

C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/

QuestionImage is not showing Pin
krishnaveer10-Dec-09 21:10
krishnaveer10-Dec-09 21:10 
AnswerRe: Image is not showing Pin
Abhishek Sur10-Dec-09 21:35
professionalAbhishek Sur10-Dec-09 21:35 
GeneralRe: Image is not showing Pin
farogh haider14-Dec-09 19:16
farogh haider14-Dec-09 19:16 
AnswerRe: Image is not showing Pin
sashidhar10-Dec-09 21:40
sashidhar10-Dec-09 21:40 
GeneralRe: Image is not showing Pin
krishnaveer10-Dec-09 21:49
krishnaveer10-Dec-09 21:49 
GeneralRe: Image is not showing Pin
sashidhar10-Dec-09 21:53
sashidhar10-Dec-09 21:53 
GeneralPopup with listbox in asp.net Pin
Nekkantidivya10-Dec-09 20:33
Nekkantidivya10-Dec-09 20:33 
GeneralRe: Popup with listbox in asp.net Pin
Blue_Boy10-Dec-09 20:44
Blue_Boy10-Dec-09 20:44 
Questiondrag and drop file uploading.... Pin
Subin Mavunkal10-Dec-09 20:07
Subin Mavunkal10-Dec-09 20:07 
AnswerRe: drag and drop file uploading.... Pin
dan!sh 10-Dec-09 20:55
professional dan!sh 10-Dec-09 20:55 
AnswerRe: drag and drop file uploading.... Pin
Abhishek Sur10-Dec-09 21:02
professionalAbhishek Sur10-Dec-09 21:02 
GeneralRe: drag and drop file uploading.... Pin
Subin Mavunkal10-Dec-09 22:17
Subin Mavunkal10-Dec-09 22:17 
GeneralRe: drag and drop file uploading.... Pin
Abhishek Sur10-Dec-09 22:51
professionalAbhishek Sur10-Dec-09 22:51 
QuestionCountry,State, City.. Pin
Hema Bairavan10-Dec-09 19:47
Hema Bairavan10-Dec-09 19:47 
AnswerRe: Country,State, City.. Pin
sashidhar10-Dec-09 20:07
sashidhar10-Dec-09 20:07 
GeneralRe: Country,State, City.. Pin
Hema Bairavan10-Dec-09 20:14
Hema Bairavan10-Dec-09 20:14 
GeneralRe: Country,State, City.. Pin
sashidhar10-Dec-09 20:21
sashidhar10-Dec-09 20:21 

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.