Hi all,
I am struggling with some syntax for accessing the EpiUltraGrids that are automatically added to my dashboards when I add a BAQ. The system names the grids all ‘myGrid’. I want to be able to do things like check what record is selected on a grid, select a different record, and change the record that is initially selected on load.
I believe I need to reference my EpiUltraGrids EpiBinding value. I just can’t seem to find the right syntax to put it all together. Here is some pseudocode I have been toying with:
// ---- WARNING PSEUDOCODE ONLY! ----
//Select and set active row to first row.
EpiUltraGrid MyLeftGrid = EpiBinding(V_Cust_OurUnmatchedOrders_faster_1View);
EpiUltraGrid MyRightGrid = EpiBinding(V_Cust_OpenOrderRequests_Fast_1View1);
MyLeftGrid.SelectedRow = 0; // or first row
MyLeftGrid.SelectedRow.Activate;
MyRightGrid.SelectedRow = 0; // or first row
MyRightGrid.SelectedRow.Activate;
// Find a row in MyLeftGrid with a PartNum in a column, then select and activate it
For each row in MyLeftGrid
{
if (MyLeftGrid.Column("PartNum") == FindPart)
{
MyLeftGrid.SelectedRow = row;
MyLeftGrid.SelectedRow.Activate;
}
}
If you know the right way to accomplish this, I would greatly appreciate any advice you have to offer.
You should be able to find the EpiGuid in the customization tools dialog for that dashboards EpiUltraGrid, and reference it with that.
I added a button to MES that pulls up the Job Traveler for the job selected on the MES grid. Here’s some of the setup code:
EDIT. usings (should be the only ones needed?):
using Infragistics.Win.UltraWinGrid;
using Infragistics.Win;
// Add Custom Module Level Variables Here **
EpiUltraGrid mesGrid;
// Begin Wizard Added Variable Initialization
mesGrid = (EpiUltraGrid)csm.GetNativeControlReference("a9cf2b4f-03f2-499e-9744-c311af7f8172");
//stuff in the click function
// Get Active Row
UltraGridRow ultraGridRow = mesGrid.ActiveRow;
//Get a row's cell value for particular column
jobNum = ultraGridRow.GetCellValue("JobNum").ToString();
This was helpful. I can now reference the correct grids.
However I am having trouble making each grid have the top record selected and activated. Using the code below the form opens, then sets the selected/active row to the top row, then clears any expanded groups.
The code compiles and works, but after everything in my code is done, my grid still selects a part number half way down the list and expands the group. I think I am doing things in the wrong order. Should I be looking at a different event? I would like the form to open to the top row, and after every refresh, go back to the top row and expand the first row.
I figured out that I had to sort my BAQ to have the correct first record show up first. The display sort in my dashboard was set differently than my BAQ sort, so things didn’t line up quite right. Seems to be ok now.
Thanks!!
Go into customization mode, then you can find the grid in the list of the tree view, and find the GUID on the properties tab. You can also click a grid then go to the properties tab (while in customization mode)
If you haven’t already, will need to deploy the dashboard as assembly, create a menu item for it, then launch the actual dashboard in customization mode.