Dashboard Hyperlinks

Has anyone found a way to make text into a hyperlink in a dashboard grid row?
Or maybe, when the row is selected, have a button click event open the path that’s in the column?

You can use a URL view to view the value in the row. I haven’t tried making a hyperlink.

1 Like

If you know how to get the UltraGrid and the Row/Cell via csm.GetNativeControl then you can change its type:

e.Row.Cells["Value"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.URL;

Then the grid will raise a CellLinkClicked event in your code. I don’t have a sample to paste at this time, but that would be the gist of it.

Remember Epicor runs on Infragistics - you can view or google Infragistics UltraGrid how to bla bla and you will find samples, you can add in a Customization Layer of Dashboard.

4 Likes

Thanks @hkeric.wci. That was deceptively simple!

@hmwillett I know this is an old thread, but I am trying to accomplish the same thing, except I am missing something.

Could you post a snippet of how you were able to get this to work?

Sure, here ya go:

    public class Script
    {
       // ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
       // Begin Wizard Added Module Level Variables **
       EpiUltraGrid grid1;
       // End Wizard Added Module Level Variables **

       // Add Custom Module Level Variables Here **

       public void InitializeCustomCode()
       {
          // ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
          // Begin Wizard Added Variable Initialization
          this.grid1 = (EpiUltraGrid)csm.GetNativeControlReference("e4989f9a-c2a5-4ff4-bd19-47e68fd02fa9");
          // End Wizard Added Variable Initialization

          // Begin Wizard Added Custom Method Calls

          // End Wizard Added Custom Method Calls
       }

       public void DestroyCustomCode()
       {
          // ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
          // Begin Wizard Added Object Disposal
          this.grid1 = null;
          // End Wizard Added Object Disposal

          // Begin Custom Code Disposal

          // End Custom Code Disposal
       }

       private void MainController_Load(object sender, EventArgs args)
       {
          // Add Event Handler Code

          grid1.DisplayLayout.Bands[0].Columns["Calculated_Hyperlink"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.URL;    
       }
6 Likes

Thanks a bunch!

That was far simpler than I expected…

Did you create a tracker in the dashboard then reference your code in the script editor or was this code done to the .dll assembly after it was deployed?

Deployed the dashboard as an assembly, then opened it in developer mode and threw the customization in there.

1 Like

@hmwillett Worked Great, Thanks.

1 Like

Just for the record - there are many more styles to chose from :slight_smile: Documentation Archives | Infragistics

@hmwillett - I know this is an older thread, but it seems you are the go to guy on this topic! ha ha Wondering if you would be able to walk me through this - not had a lot of training, so trying to figure out some of the customs myself. I have a standard dashboard, and one of the fields that is being pull in, has an input from out QC operators - which is a file location on our network, so i am looking for that field to be an active hyperlink (so that we don’t have to copy and paste into windows)…not having much luck…

@adamk what have you tried so far and what hasn’t worked?

So far i took your custom script and added that to the code section on the dashboard once deployed…its didn’t do anything for me as I assume I need to change it to relate to my dashboard?

grid1.DisplayLayout.Bands[0].Columns["Calculated_Hyperlink"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.URL; 

Have you changed the column name to match your own? Mine was named “Calculated_Hyperlink” as defined in the BAQ feeding the dashboard.

**Also, have you deployed the customization to your dashboard through Menu Maintenance?

I hadn’t…but just did…and don’t see any change. the “grid.1” that is noted in your code, is referring to the name of the grid? What does this line refer too:

this.grid1 = (EpiUltraGrid)csm.GetNativeControlReference(“e4989f9a-c2a5-4ff4-bd19-47e68fd02fa9”);

That’s the reference to your actual control.
You should change the string to match the GUID from your grid.
You can find that by clicking the grid in developer mode, then going to the properties tab.
There should be a box for GUID. Copy that and paste it in place of the e4989f9a-c2a5-4ff4-bd19-47e68fd02fa9, which is unique to mine.

Ok so I updated that…still not having much luck, Now when I am loading the dashboard I get the following error:

--------compile errors------------
** Error: CS1513 - line 58 (132) - } expected**
** ** Compile Failed. ****

Here is the code I have within the dashboard…really appreciate all the help so far!

public class Script
    {
       // ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
       // Begin Wizard Added Module Level Variables **
       EpiUltraGrid myGrid;
       // End Wizard Added Module Level Variables **

       // Add Custom Module Level Variables Here **

       public void InitializeCustomCode()
       {
          // ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
          // Begin Wizard Added Variable Initialization
          this.myGrid = (EpiUltraGrid)csm.GetNativeControlReference("dab7a769-c466-4ba1-819e-f6a9217f8e00");
          // End Wizard Added Variable Initialization

          // Begin Wizard Added Custom Method Calls

          // End Wizard Added Custom Method Calls
       }

       public void DestroyCustomCode()
       {
          // ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
          // Begin Wizard Added Object Disposal
          this.myGrid = null;
          // End Wizard Added Object Disposal

          // Begin Custom Code Disposal

          // End Custom Code Disposal
       }

       private void MainController_Load(object sender, EventArgs args)
       {
          // Add Event Handler Code

          myGrid.DisplayLayout.Bands[0].Columns["LaborDtl_Comment_c"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.URL;    
       }

Line 58 in your script is looking for a closing curly.
Make sure all of your curly braces match.

ok so i seem to be moving backwards…I noticed that my first section was missing a closed { to contain that argument…I added that and now I have a wack load of more errors…

--------compile errors------------
Error: CS1518 - line 30 (104) - Expected class, delegate, enum, interface, or struct
Error: CS1518 - line 42 (116) - Expected class, delegate, enum, interface, or struct
Error: CS1518 - line 54 (128) - Expected class, delegate, enum, interface, or struct
Error: CS1001 - line 58 (132) - Identifier expected
Error: CS1001 - line 58 (132) - Identifier expected

I feel like I am missing a good chunk of information…hopefully this isn’t taking too much of your time!