Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
185
Setting the root location to an arbitrary location
posted

Hi

I wish to set the RootLocation item's Text property to a folder which is not at the top of a hierarchy.

E.g.

UltraNavigationBarLocation rootLocation = navBar.RootLocation;

rootLocation.Text = @"C:\MyApp\Workspace";

 

The problem is that I get an exception due to path separators within the string.

I'm sure it's something trivial, but I can't find anything in the documentation regarding this.

Thanks David

Parents
  • 69832
    Offline posted

    As a general rule, you cannot assign a value to the Text property that contains the path separator, since the path parsing logic would not be able to identify locations from a string.

    I might be speculating a bit here, but it looks like you are trying to change the root location while keeping the contents of the respective Locations collections the same, which is not supported. Once the Locations collections are populated, you cannot redefine the root location. Going by your example, instead of populating from the root drive, i.e., "C:", you would have to assign the "C:\MyApp\Workspace" folder to the RootLocation property, and populate from there. If I am misinterpreting this, please repost and clarify exactly what you are trying to accomplish and we will try to help.

Reply Children