Posted by: R Manimaran | February 27, 2007

IE TreeView Control ‘s Selected Node Text

While Using TreeView control, we have to set the Autopostback property to true.To get the selected nodes text use the following code  Code:Event: TreeView1_SelectedIndexChange Microsoft.Web.UI.Controls.TreeNode node=null;string delimstr=”.”;

char[] delimiter=delimstr.ToCharArray();

string [] split=null;
split=e.NewNode.Split(delimiter,100);

foreach(string s in split)

{ 

  if(node==null)    

           node=Treeview1.Ndoes[int.parse(s)];

  else 

          node =node.Nodes[int.Parse(e)];

}

Label.Text=node.Text; 

Advertisements

Responses

  1. people are stranger


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: