Is it possible to change the path of a URL View in a dashboard programatically?

I found a solution but it’s not perfect (but it works well so far). I create a WebBrowser and I define myself the URL. I need to create the toolbar and the buttons (previous, forward, refresh) manually:

In class Script, initialize this variable:

private WebBrowser browserDisplay = new WebBrowser();`

In InitializeCustomCode(), initialize the Webbrowser:

        EpiBasePanel TrackerPanel = (EpiBasePanel)csm.GetNativeControlReference("9fc6a346-e062-4c54-a790-6e37882f4463-4"); // put your Guid instead
        browserDisplay.Dock = System.Windows.Forms.DockStyle.Bottom;
        browserDisplay.Location = new System.Drawing.Point(0, 40);
        browserDisplay.MinimumSize = new System.Drawing.Size(20, 20);
        browserDisplay.Name = "browserDisplay";
        browserDisplay.Size = new System.Drawing.Size(784, 561);
        browserDisplay.TabIndex = 9999;
        browserDisplay.WebBrowserShortcutsEnabled = false;
        browserDisplay.IsWebBrowserContextMenuEnabled = false;
        browserDisplay.ScriptErrorsSuppressed = true;
        TrackerPanel.Controls.Add(browserDisplay); //TrackerPanel is the name of the Control where you want your file explorer
        browserDisplay.BringToFront();
        /*navigate to a blank page on initialization*/
        string url = @"\\server\Fichiers\Clients\";
        browserDisplay.Navigate(url);

    ToolStrip mainToolBar = new ToolStrip();  
    mainToolBar.Size = new System.Drawing.Size(400, 40);
    Color color = Color.FromArgb(255,88,85,85);
    mainToolBar.BackColor = color;
    //create previous button
    ToolStripButton buttonPrevious = new ToolStripButton();
    buttonPrevious.Image = EpiUIImages.SmallEnabledImages.Images[EpiUIImages.IndexOf("PickerRemove")];
    buttonPrevious.Click += new System.EventHandler(buttonPrevious_Click);
    //create forward button
    ToolStripButton buttonForward = new ToolStripButton(); 
    buttonForward.Image = EpiUIImages.SmallEnabledImages.Images[EpiUIImages.IndexOf("PickerAdd")]; 
    buttonForward.Click += new System.EventHandler(buttonForward_Click);
    //create refresh button
    ToolStripButton buttonRefresh = new ToolStripButton();
    buttonRefresh.Image = EpiUIImages.SmallEnabledImages.Images[EpiUIImages.IndexOf("Refresh")];  
    buttonRefresh.Click += new System.EventHandler(buttonRefresh_Click);
    // add buttons to toolbar
    mainToolBar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         buttonPrevious,
         buttonForward,
    	 buttonRefresh
    });

TrackerPanel.Controls.Add(mainToolBar);

In whatever event in your code, you can change the URL with this:

string url = @"\\server\Fichiers\Clients\" + customerName + @"\" + projectID + " - " + projectDescription + @"\";
		if(Directory.Exists(url))
		{
			browserDisplay.Navigate(url);
		}
		else
		{
			browserDisplay.Navigate(@"\\server\Fichiers\Clients\");
		}
2 Likes