How to Tell EpiUltraGrid Has Finished Loading Data

Good afternoon Mega-Minds!

I have a dashboard with an EpiUltraGrid that loads data from a BAQ (pretty basic stuff). What I’m needing to do is loop through all the rows in the grid and check which ones are 7 days away from shipping. I need to do this automatically when the form loads. Initially, I added the code to the Form_Load method, but the grid hadn’t finished populating by the time the code triggered, so nothing was getting checked. I thought maybe if I added an AfterAdapterMethod to my code that might be the place to do my looping, but it turns out that even though I have my adapters loaded in, they don’t show in the Wizard…

image

Any ideas on how I can get the loop to perform after the form loads and the grid has been populated? Thank you for your time and have a great day!

There is a Row_Initialized event you can tie in the grid and so then you can do it as each row is added. What’s your end goal though? What are you doing with those rows?


this.grdList.InitializeRow += new Infragistics.Win.UltraWinGrid.InitializeRowEventHandler(this.grdList_InitializeRow);

private void grdList_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
	{
//e.Row.Cells["TranDocTypeID"].Value
}
3 Likes

Thank you @josecgomez! The dashboard shows all projects that are in production. My company links only one quote and sales order to a project, so the end goal is to look up parts on a sales order and check the ship date for those that are Make Direct. If the ship date is within 7 days of the current date, then they want production to confirm that it will ship on time.

Somewhere in the past, I’ve wanted to perform an auto resize grid column AFTER the data was all loaded. If I recall correctly, the grid was binded to an BAQDataView. The BAQDataView has (and probably the EpiDataview) a private event called DoneExecuting. Using reflection, I’ve been able to hook an hanlder from there.

EDIT.

Dont’ go down that road if you don’t know what your doing. Please.

public event EventHandler AfterRefresh; 
private void BAQDataView_AfterExecuting(object sender, EventArgs e) => OnAfterRefresh(EventArgs.Empty); 
protected virtual void OnAfterRefresh(EventArgs e) => AfterRefresh?.Invoke(this, e);

private void AddEventOnDoneExecuting()
 {      

    Type t = typeof(BAQDataView);   
    Delegate myHandler = (EventHandler)BAQDataView_AfterExecuting;   
    EventInfo info = t.GetEvent("DoneExecuting", BindingFlags.NonPublic | BindingFlags.Instance);               
    var addMethod = info.GetAddMethod(true);   
    addMethod.Invoke(this.myMainView, new[] { myHandler }); 
}
1 Like

@ShawnLeenerts You could you do the 7 day check in getlist of the baq. Then it comes in fully populated.

1 Like