Add column to multi-resource

Sorry forgot to include the code

// **************************************************
// Custom code for ResourceSchedForm
// Created: 11/5/2012 9:22:09 AM
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Epicor.Mfg.BO;
using Epicor.Mfg.UI;
using Epicor.Mfg.UI.Adapters;
using Epicor.Mfg.UI.Customization;
using Epicor.Mfg.UI.ExtendedProps;
using Epicor.Mfg.UI.FormFunctions;
using Epicor.Mfg.UI.FrameWork;
using Epicor.Mfg.UI.Searches;
using Infragistics.Win.UltraWinGrid;
using Epicor.Mfg.Core;
using Epicor.Mfg.Lib;

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

// End Wizard Added Module Level Variables **

// Add Custom Module Level Variables Here **
private EpiUltraGrid grdList;
private BOReader boReader;

public void InitializeCustomCode()
{
// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
// Begin Wizard Added Variable Initialization
grdList = (EpiUltraGrid)csm.GetNativeControlReference("f505d266-c231-4bad-89f8-466141392d49");
grdList.InitializeRow += new InitializeRowEventHandler(grdList_InitializeRow);
boReader = new BOReader(((Session)oTrans.Session).ConnectionPool);
// 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
grdList = null;
grdList.InitializeRow -= new InitializeRowEventHandler(grdList_InitializeRow);
boReader = null;
// End Wizard Added Object Disposal

// Begin Custom Code Disposal

// End Custom Code Disposal
}

private void grdList_InitializeRow(object sender, InitializeRowEventArgs e)
{
string jobPartNum = e.Row.Cells["JobPartNum"].Value.ToString();
string whereClause = String.Format("PartNum='{0}'",jobPartNum);
string fieldSelect = "Character04";
DataSet dsPart = boReader.GetRows("Part",whereClause,fieldSelect);

if(dsPart.Tables[0].Rows.Count > 0)
{
e.Row.Cells["PrintName"].Value = dsPart.Tables[0].Rows[0]["Character04"].ToString();
}

dsPart = null;
}

private void ResourceSchedForm_Load(object sender, EventArgs args)
{
// Add new column to grdList
grdList.DisplayLayout.Bands[0].Columns.Add("PrintName","Print Name");
}
}

--- In vantage@yahoogroups.com, "jgiese1988" <epicor-team@...> wrote:
>
> I have added the Character04 field from Part to the Multi-Resource Sched board. It works with the code pasted below, but it is sloooooooooooooooooooooooowwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww.... is there another way I can be doing this for a grid that has so many rows? ideally in a BPM?
>
I have added the Character04 field from Part to the Multi-Resource Sched board. It works with the code pasted below, but it is sloooooooooooooooooooooooowwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww.... is there another way I can be doing this for a grid that has so many rows? ideally in a BPM?
Sorry forgot to include code. I commented out the BOReader to increase performance for now.

// **************************************************
// Custom code for ResourceSchedForm
// Created: 11/5/2012 9:22:09 AM
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Epicor.Mfg.BO;
using Epicor.Mfg.UI;
using Epicor.Mfg.UI.Adapters;
using Epicor.Mfg.UI.Customization;
using Epicor.Mfg.UI.ExtendedProps;
using Epicor.Mfg.UI.FormFunctions;
using Epicor.Mfg.UI.FrameWork;
using Epicor.Mfg.UI.Searches;
using Infragistics.Win.UltraWinGrid;
using Epicor.Mfg.Core;
using Epicor.Mfg.Lib;

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

// End Wizard Added Module Level Variables **

// Add Custom Module Level Variables Here **
private EpiUltraGrid grdList;
private BOReader boReader;

public void InitializeCustomCode()
{
// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
// Begin Wizard Added Variable Initialization
grdList = (EpiUltraGrid)csm.GetNativeControlReference("f505d266-c231-4bad-89f8-466141392d49");
//grdList.InitializeRow += new InitializeRowEventHandler(grdList_InitializeRow);
boReader = new BOReader(((Session)oTrans.Session).ConnectionPool);
// 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
grdList = null;
//grdList.InitializeRow -= new InitializeRowEventHandler(grdList_InitializeRow);
boReader = null;
// End Wizard Added Object Disposal

// Begin Custom Code Disposal

// End Custom Code Disposal
}

//private void grdList_InitializeRow(object sender, InitializeRowEventArgs e)
//{
//string jobPartNum = e.Row.Cells["JobPartNum"].Value.ToString();
//string whereClause = String.Format("PartNum='{0}'",jobPartNum);
//string fieldSelect = "Character04";
//DataSet dsPart = boReader.GetRows("Part",whereClause,fieldSelect);

//if(dsPart.Tables[0].Rows.Count > 0)
//{
// e.Row.Cells["PrintName"].Value = dsPart.Tables[0].Rows[0]["Character04"].ToString();
//}

//dsPart = null;
//}

private void ResourceSchedForm_Load(object sender, EventArgs args)
{
// Add new column to grdList
grdList.DisplayLayout.Bands[0].Columns.Add("PrintName","Print Name");
}
}

--- In vantage@yahoogroups.com, "jgiese1988" <epicor-team@...> wrote:
>
> I have added the Character04 field from Part to the Multi-Resource Sched board. It works with the code pasted below, but it is sloooooooooooooooooooooooowwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww.... is there another way I can be doing this for a grid that has so many rows? ideally in a BPM?
>