The situation is that I wanted the ParentPart_C for the related JobNum to be available in the Material List(mtlSuggGrid) view and the Subcontract List(mtlSubContractGrid) view in the Purchase Order form. I wrote a BAQ that gets the ParentPart_C and the JobNum from JobHead and shows it under the two above-mentioned views. All of this works.
However, when I populate the form with multiple entries it takes too long. To populate 2000 entries it takes 25 mins.
private void mtlSuggGrid_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
{
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters.Add("JobNumber",e.Row.Cells["JobNum"].Value.ToString());
DataTable dtJobDetails = GetBAQData("NML_ParentPartInPO",parameters);
if(dtJobDetails.Rows.Count > 0)
{
e.Row.Cells["ParentPart_c"].Value = Convert.ToString(dtJobDetails.Rows[0]["JobHead_ParentPart_c"]);
}
}
private void mtlSubContractGrid_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
{
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters.Add("JobNumber",e.Row.Cells["JobNum"].Value.ToString());
DataTable dtJobDetails = GetBAQData("NML_ParentPartInPO",parameters);
if(dtJobDetails.Rows.Count > 0)
{
e.Row.Cells["ParentPart_c"].Value = Convert.ToString(dtJobDetails.Rows[0]["JobHead_ParentPart_c"]);
}
}
private void GetParentPart(string jobnum)
{
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters.Add("JobNumber",jobnum);
DataTable dtJobDetails = GetBAQData("NML_ParentPartInPO",parameters);
if(dtJobDetails.Rows.Count > 0)
{
tbParentPart.Text = Convert.ToString(dtJobDetails.Rows[0]["JobHead_ParentPart_c"]);
}
}
private void edvSugPoDtl_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
{
if ((args.NotifyType == EpiTransaction.NotifyType.Initialize))
{
if ((args.Row > -1))
{
GetParentPart(Convert.ToString(view.dataView[args.Row]["JobNum"]));
}
}
}
Any help is appreciated.