Skip to Content
0
Former Member
Feb 20, 2009 at 03:53 PM

ComboBox Matrix First Line Empty

52 Views

Hi,

I have build a Matrix with a combo box ( ...a old story...); but when the form loads, the first line in the combo box is empty.

I start filling the Combo Box from position 0...

Thanks 😊

Rune

oRecordset = ((SAPbobsCOM.Recordset)(oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)));

bool vmp_Language_EN_bool = true;
m_Language(out vmp_Language_EN_bool);

if (vmp_Language_EN_bool)
{
    vDoQuery_string = "SELECT [Code],[U_English] FROM [dbo].[@FCSDK_PAY_TYPE]";
}
else
{
    vDoQuery_string = "SELECT [Code],[Name] FROM [dbo].[@FCSDK_PAY_TYPE]";
}

oRecordset.DoQuery(vDoQuery_string);
vm_Recordset_Count_long = oRecordset.RecordCount;
oRecordset.MoveFirst();

SAPbouiCOM.Matrix oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx_F_AA").Specific;
SAPbouiCOM.Column oColumn = (SAPbouiCOM.Column)oMatrix.Columns.Item("mtxV_0");

for (vRecordsetIndex_long = 0; vRecordsetIndex_long <= vm_Recordset_Count_long - 1; vRecordsetIndex_long++)
{
    oColumn.ValidValues.Add(System.Convert.ToString(oRecordset.Fields.Item(0).Value), System.Convert.ToString(oRecordset.Fields.Item(1).Value));
    
    oRecordset.MoveNext();
}

oRecordset = null;
System.GC.Collect();