Microsoft.Web.UI.WebControls.TreeView Problem

M

Mrunal

Hi,
I am using TreeView Control to store data. The problem is
that the code within the events is not fired.. i want to
add the text of selected node to a list.
-----------Code file----------------------
protected Microsoft.Web.UI.WebControls.TreeView TreeCtrl;
public ListBox ListBox1;
public Label mylabel;

void mySelectChangeFn(Object sender,
TreeViewSelectEventArgs e)
{
ListBox1.Items.Add(e.NewNode.ToString());
}

-------------ASPX file---------------------
<iewc:treeview id="TreeCtrl"
onclick="myClick"
onselectedindexchanged="mySelectChangeFn"
autopostback="true"
runat="server"
SystemImagesPath="/webctrl_client/1_0/treeimages/">
</iewc:treeview>

<asp:ListBox id="ListBox1" runat="server" Width="146px"
Height="184px" />

Any ideas what could be the problem..? the tree is
displaying properly..
Thanks
Mrunal
 
M

Mohamed El Ashmawy

The e.NewNode.ToString() doesn't return the text of the selected node.
Use TreeCtrl.GetNodeFromIndex(e.NewNode).Text instead of
e.NewNode.ToString()

Regards
Mohamed El Ashmawy
MEA Developer Support Center
ITWorx on behalf of Microsoft EMEA GTSC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top