cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

About sap b1 sdk use

a_17mango
Explorer
0 Likes
286

private void OnCustomInitialize()
{
oForm = (SAPbouiCOM.Form)sbo_app.Forms.ActiveForm;


if (oForm.DataSources.DataTables.Count == 0)
{
dt = oForm.DataSources.DataTables.Add("dt");
}
else
{
try
{
dt = oForm.DataSources.DataTables.Item("dt");
}
catch
{
dt = oForm.DataSources.DataTables.Add("dt");
}
}
string query = "SELECT u_t001 FROM [@itemproperties2]";
dt.ExecuteQuery(query);


Matrix0.Clear();


SAPbouiCOM.Column column = Matrix0.Columns.Item("cl_a");
column.DataBind.Bind("dt", "u_t001");


Matrix0.LoadFromDataSource();


if (Matrix0.RowCount > 0)
{

a_17mango_0-1741948405143.png

 


Matrix0.SelectRow(1, true, false);
}
}

a_17mango_1-1741948408351.png

I want to ask how to set martix to load data when it is opened? I set up the data source and bind data to the corresponding column, why is it not automatically loaded when it is opened, or why is it not displayed?

Accepted Solutions (0)

Answers (2)

Answers (2)

williamwachholz
Active Participant
0 Likes

Hello,

 

Try to change the way you bind the matrix column to the datasource:

column.DataBind.SetBound(true, "dt", "u_t001");

 

Best regards

williamwachholz
Active Participant
0 Likes

Hello,

 

Try to change the way you bind the matrix column to the datasource:

column.DataBind.SetBound(true, "dt", "u_t001");

 

Best regards