I am wanting to add a SOH column to Bill Maintenance inputs grid.
I can easily add a column but can't work out how I can get the SOH value for each input row. I'm guessing it's fairly easy but for some reason I'm getting a brainblock.
This is what I have so far
- Code: Select all
public void Setup(JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm JiwaForm, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
{
if (JiwaForm is JiwaFinancials.Jiwa.JiwaBillOfMaterialsUI.BillMaintenance.BillMaintenance)
{
JiwaFinancials.Jiwa.JiwaBillOfMaterialsUI.BillMaintenance.BillMaintenance BillMaintForm = (JiwaFinancials.Jiwa.JiwaBillOfMaterialsUI.BillMaintenance.BillMaintenance)JiwaForm;
BillMaintForm.InputsJiwaGrid.AddColumn("SOH", new FarPoint.Win.Spread.CellType.NumberCellType(), "SOH", 5, false, true, true, true, 255, false, false, 0, false);
BillMaintForm.InputsJiwaGrid["SOH", -1] = ????;
}
}
First problem is that I'm getting an error "Cannot apply indexing with [] to an expression of type JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid. This happens if I just force a static SOH like
- Code: Select all
BillMaintForm.InputsJiwaGrid["SOH", -1] = 10;
Second issue is getting the actual SOH value. I'm suspecting I need to loop through the rows in the InputsJiwaGrid, get the InventoryID, the INLogicalID and just do a SQL SELECT to find the SOH. What would be the syntax to loop through the rows? I'm fine to create a decimal function which returns the SOH, it's just the looping I'm having trouble with. Or is that even the best way to get SOH for each input row?