Click here to Skip to main content
15,909,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi how disable path separator in treeview
im using tree view to display all the files and folders, and im selecting one of the node or childnode and selected node or child node is added to textbox, till this ok
but my problem is if im selecting c:\programs
then im getting the o/p in textbox as
c:\/programs
that is my path seperator by default is /
now i want to disable path seperator i.e /
how to disable path seperator
Posted

Have you tried simply changing the PathSeparator to an empty string?

you could set this via code treeview.PathSeparator = String.Empty
 
Share this answer
 
Comments
Anil Sarda 11-May-10 8:50am    
yes i have tried with empty string, even tough it is adding / as path seperator
and now i tried TreeView1.PathSeparator = String.Empty
for this also it is getting / as path seperator
can u suggest some other code, than q
If the root node label is c:\ then you will get this problem. The solution would be to set the label to c: by trimming off trailing backslashes.

e.g. dirname = dirname.TrimEnd('\\');

Alan.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900