[C#] Get Selected Row in Dashboard

Good Morning Everyone,

I’m attempting to make a button on a dashboard to pre-format an email by grabbing the row selected in the grid and passing info from that row into a Mailto process.

However, I’m having trouble finding a way to grab the row selected.
I’m currently using C# for the scripts.

What I was thinking was to use

EpiDataView myData = (EpiDataView)(oTrans.EpiDataViews["V_LSG_Project_1View"]);
int rowNum = myData.SelectedIndex();

//Get Column information
Guid myGuid = myData.dataView[rowNum]["XXX"]

Am I off base here?

You could do it with an EpiUltraGrid object, not sure about a dataView. Here’s some snippets for getting active row off the MES grid.

using Infragistics.Win.UltraWinGrid;

EpiUltraGrid mesGrid;
mesGrid = (EpiUltraGrid)csm.GetNativeControlReference("a9cf2b4f-03f2-499e-9744-c311af7f8172");
UltraGridRow ultraGridRow = mesGrid.ActiveRow;
jobNum = ultraGridRow.GetCellValue("JobNum").ToString();
2 Likes

I did a presentation last insights on this. There is something along the lines of what you’re after there I think.

1 Like

Hey, thanks for replying so promptly!
I’m hitting a snag with a “Key not found” issue.

In this case, what is the key being used? Is this the column name of the grid or the name of the row?

1 Like

The key will be a column name from the dataview the grid is bound to. If you are in customization mode you can go to Tools -> Object Explorer -> Data Objects then you can see a list of all the column names for the dataView.

1 Like

Much obliged!