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
1210
URGENT!!! error on ultraNavigationBar
posted

this.ultraNavigationBar1.RootLocation.Text = @"C:\CMT\";

 

or:

this.ultraNavigationBar1.RootLocation.Text = @"C:\CMT";

gives me this error:

An UltraNavigationBarLocation cannot contain the PathSeparator in any part of the text which is used to identify it when parsing a navigation path.

How do I specify a starting folder?

 

Parents Reply
  • 53790
    posted in reply to ross

    Please download this sample: UltraNavigatorBarPresetLocation.zip 

    Here ia the code:

    public partial class Form1 : Form

        {

            public Form1()

            {

                InitializeComponent();

                ultraNavigationBar1.InitializeLocations += new Infragistics.Win.Misc.UltraWinNavigationBar.InitializeLocationsHandler(ultraNavigationBar1_InitializeLocations);

            }

     

            void ultraNavigationBar1_InitializeLocations(object sender, Infragistics.Win.Misc.UltraWinNavigationBar.InitializeLocationsEventArgs e)

            {

                DirectoryInfo[] dirs = new DirectoryInfo(e.ParentLocation.Key + "\\").GetDirectories();

                foreach (DirectoryInfo dir in dirs)

                {

                    e.ParentLocation.Locations.Add(dir.FullName, dir.Name);

                }

            }

     

     

            private void Form1_Load(object sender, EventArgs e)

            {

                DirectoryInfo[] dirs = new DirectoryInfo("C:\\").GetDirectories();

                foreach (DirectoryInfo dir in dirs)

                {

                    ultraNavigationBar1.RootLocation.Locations.Add(dir.FullName, dir.Name);

                }

                ultraNavigationBar1.NavigateTo("Program Files\\Microsoft Visual Studio 10.0\\Common7", true);

            }

        }

    Let me know if you have any questions.

Children