tags:

views:

506

answers:

2

Hi there. I'm using v.s 2008 with c#.

I have a treeview on a master page. And i want to change a node's text. if current user's id isn't equels 222.

if (kul.M_Kullanici_id != 222)
   {
       tvMaind.Nodes[0].ChildNodes[0].ChildNodes[0].Text = "çağın";
   }

My treeview is a sitemap. And t.v has xmldatasource. i wanna rename a node's text when user which has 222 id. I m looking current user in masterpage onunload event. and i m changing text. i can see that change on watch. but in cant see change on the page. I thing xmlsource reload after i change node's text.

thanks for your helps.

A: 

Do you want to delete a node? However your code is to update a node text.

adatapost
+1  A: 

You just retrieve required TreeNode and set its Text property.

> tvMenu.Nodes[I].Text = ""; // I: index of node to be retrieved.
Ahmed
it doesnt work...
cagin
@cagin: do you have any error? shall you tell me the node you need to identify?
Ahmed
No i havent any error. but any changes on the treeview. I thinnk that treeview reload from xml when i changed node's text. I change that on unload event of masterpage.
cagin
I afraid I cannot understand you, what do you mean by "I think that treeview reload from xml when i changed node's text"?
Ahmed
Okay. My treeview is a sitemap. And t.v has xmldatasource. i wanna rename a node's text when user which has 222 id. I m looking current user in masterpage onunload event. and i m changing text. i can see that change on watch. but in cant see change on the page. I thing xmlsource reload after i change node's text.
cagin
@cagin: try to update node text after binding treeview to xmldatasource, this will solve your issue.
Ahmed