Hi,
I need some help. I have this code working which adds the OrderHed.Checkbox01 field to “Picked Orders”. The field is boolean in the table but comes back as string.
I will like to see it on the grid as a checkbox. Is there any code that will convert the column to boolean, or how can I change the code so that the column is born as boolean?
I tried to change the format in Extended properties but it did not work; maybe I’m doing it wrong.
Thanks,
public class Script
{
//private EpiDataView edvPickedOrders;
EpiUltraGrid myGrid;
BOReaderImpl _boReader;
public void InitializeCustomCode()
{
// Begin Wizard Added Custom Method Calls
SetExtendedProperties();
myGrid = (EpiUltraGrid)csm.GetNativeControlReference("65ef8a4d-0c7d-45a7-8c65-6ff73cf71cb1");
myGrid.DisplayLayout.Bands[0].Columns.Add("Checkbox01","NonASN");
myGrid.InitializeRow += new Infragistics.Win.UltraWinGrid.InitializeRowEventHandler(grdMatLst_InitializeRow);
_boReader = WCFServiceSupport.CreateImpl<BOReaderImpl>((Ice.Core.Session)oTrans.Session, Epicor.ServiceModel.Channels.ImplBase<Ice.Contracts.BOReaderSvcContract>.UriPath);
// End Wizard Added Custom Method Calls
}
public void DestroyCustomCode()
{
// End Custom Code Disposal
myGrid.InitializeRow -= new Infragistics.Win.UltraWinGrid.InitializeRowEventHandler(grdMatLst_InitializeRow);
_boReader = null;
}
private void grdMatLst_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
{
if(!String.IsNullOrEmpty(e.Row.Cells["OrderNum"].Value.ToString()))
{
DataSet ds = _boReader.GetRows("Erp:BO:SalesOrder","OrderNum = '" + e.Row.Cells["OrderNum"].Value.ToString() + "'","OrderNum, Checkbox01");
if(ds.Tables[0].Rows.Count > 0 )
{
e.Row.Cells["NonASN"].Value = ds.Tables[0].Rows[0]["Checkbox01"];
}
}
}