Hi.
<b>Problem:</b>
I'm having trouble finding a proper way to extract my text data from a Matrix Cell that holds a LinkedButton.
<b>Current condition:</b>
I have a Matrix that is bound to some data via. a user defined object.
<b>Temporary solution:</b>
I have found a way by going through the form's DataSource and getting the value by defining the DB-table, DB-field and what row i'm interested in. My current C# code for this looks like this:
<i>Column col = matrix.Columns.Item(colUID);
matrix.LoadFromDataSource();
String MyValue = Form.DataSources.DBDataSources.Item(DBtabel).GetValue(DBfield, RowNr);</i>
<b>Secondary problem:</b>
A DataSource is not always "up to date" with the data that is shown in the matrix. Matrix.LoadFromDataSource(); and Matrix.FlushToDataSource(); have to used frequently.
Are there really no other method for this ?
Here is the way I did it, it's in VB, it may help you
Public Function GetDataFromMatrix(ByVal oForm As SAPbouiCOM.Form, ByVal MatrixName As String, ByVal ColName As String, ByVal RowNumberStart1 As Int16) As String
Dim oMatrix As SAPbouiCOM.Matrix
Dim oEditText As SAPbouiCOM.EditText
oMatrix = oForm.Items.Item(MatrixName).Specific
oEditText = oMatrix.Columns.Item(ColName).Cells.Item(RowNumberStart1).Specific
Return oEditText.Value
End Function
Add a comment