Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,836 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,610 people online right now. Registration is fast and FREE... Join Now!




How to get value of leaf node inside the gridview

 
Reply to this topicStart new topic

How to get value of leaf node inside the gridview, c#,Asp.net

ania
19 Sep, 2008 - 09:35 PM
Post #1

New D.I.C Head
*

Joined: 19 Sep, 2008
Posts: 1


could u plz help me hw to get value of a node which is niether a parent node nor a child node inside the grid view. the
treeview_SelectedNodeChange event is only sporting the , i am getting the value of selected node but getting value= "new" when it is the node which does not have child nodes. so hw can i retreive data from the database based on that treenode value...

CODE
    
    protected void tv_wbs_SelectedNodeChanged(object sender, EventArgs e)
          {
        

        int clientid = Convert.ToInt32(Session["ClientID"]);

        TreeView tr = new TreeView();

        
        TreeView get = new TreeView();
        get = (TreeView)((Control)sender);

  
        //tr = (TreeView)GridView1.DataKeys[e.]     Rows[e].Cells[0].FindControl("tv_wbs");
        string[] ID = get.SelectedNode.Value.Split(';');

        if (get.SelectedNode.Value == "New")
        {
            //for (int i = 0; i < GridView1.Rows.Count; i++)
            //{
                
                tr = (TreeView)GridView1.Rows[0].Cells[0].FindControl("tv_wbs");
                string st = Convert.ToString(tr.Nodes[0].Text);

                ds = datac.selectbynode(st, clientid);
            //}

        }
        else
        {
            ViewState["count"] = 1;
            ViewState["WBS_ID"] = Convert.ToString(ID[0]);

            

            ds = datac.selectbynode(Convert.ToString(ViewState["WBS_ID"]), clientid);
        }

            GridView2.DataSource = ds;
            GridView2.DataBind();
            
        }
    


User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/3/08 04:23PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month