on 04-19-2011 10:26 PM
hi all,
I tried to fill a row with data that is selected from a cfl how far you've come to is this ...
if (pVal.ItemUID == "colItemCod" || sCflId.ToString() == "CFL_5")
{
try
{
SAPbouiCOM.Matrix oMatrix;
int i = pVal.Row;
oMatrix = (SAPbouiCOM.Matrix)forma.Items.Item("matrix1").Specific;
forma.DataSources.DBDataSources.Item("@ZTV_LINES").SetValue("U_ItemCode", 0, System.Convert.ToString(oDataTable.GetValue("ItemCode", 0)));
forma.DataSources.DBDataSources.Item("@ZTV_LINES").SetValue("U_Dscript", 0, System.Convert.ToString(oDataTable.GetValue("ItemName", 0)));
if(i == oMatrix.RowCount)
{
oMatrix.AddRow(1, 0);
}
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
}
what happens is that when I select a specific cell value does not change...
I have another way to do it but I get an error of type "Item can not get focus"
if (pVal.ItemUID == "colItemCod" || sCflId.ToString() == "CFL_5")
{
try
{
SAPbouiCOM.Matrix oMatrix;
SAPbouiCOM.EditText oEdit;
int i = pVal.Row;
oMatrix = (SAPbouiCOM.Matrix)forma.Items.Item("matrix1").Specific;
oEdit = (SAPbouiCOM.EditText)oMatrix.GetCellSpecific("colItemCod", i);
oEdit.String = System.Convert.ToString(oDataTable.GetValue("ItemCode", 0));
if(i == oMatrix.RowCount)
{
oMatrix.AddRow(1, 0);
}
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
}
}
regards.
Hi all,
The behavior remains the same, this is the code I use to add rows to the matrix, I need to do is modify the existing values already present in the matrix.
if (pVal.ItemUID == "colItemCod" || sCflId.ToString() == "CFL_5")
{
try
{
SAPbouiCOM.Matrix oMatrix;
int i = pVal.Row;
oMatrix = (SAPbouiCOM.Matrix)forma.Items.Item("matrix1").Specific;
forma.DataSources.DBDataSources.Item("@ZTV_LINES").Clear();
oMatrix.FlushToDataSource();
forma.DataSources.DBDataSources.Item("@ZTV_LINES").SetValue("U_ItemCode", pVal.Row - 1, oDataTable.GetValue("ItemCode", 0).ToString());
forma.DataSources.DBDataSources.Item("@ZTV_LINES").SetValue("U_Dscript", pVal.Row - 1, oDataTable.GetValue("ItemName", 0).ToString());
if (i == oMatrix.RowCount)
{
oMatrix.AddRow(1, 0);
}
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
}
The process is done, I mean that values are assigned to the datasource but not show changes.
this is the way I do the matrix...
public void setMatrix()
{
SAPbouiCOM.Matrix oMatrix;
oMatrix = (SAPbouiCOM.Matrix)forma.Items.Item("matrix1").Specific;
oMatrix.AddRow(1, 0);
}
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Yesterday i have some problem with my broadband connection thats why i am not able to connect through team viewer
if (pVal.ItemUID == "colItemCod" || sCflId.ToString() == "CFL_5")
{
try
{
SAPbouiCOM.Matrix oMatrix;
int i = pVal.Row;
oMatrix = (SAPbouiCOM.Matrix)forma.Items.Item("matrix1").Specific;
forma.DataSources.DBDataSources.Item("@ZTV_LINES").Clear();
oMatrix.FlushToDataSource();
forma.DataSources.DBDataSources.Item("@ZTV_LINES").SetValue("U_ItemCode", pVal.Row - 1, oDataTable.GetValue("ItemCode", 0).ToString());
forma.DataSources.DBDataSources.Item("@ZTV_LINES").SetValue("U_Dscript", pVal.Row - 1, oDataTable.GetValue("ItemName", 0).ToString());
if (i == oMatrix.RowCount)
{
forma.DataSources.DBDataSources.Item("@ZTV_LINES").InsertRecord(i);
forma.DataSources.DBDataSources.Item("@ZTV_LINES").SetValue("U_ItemCode", i, "");
forma.DataSources.DBDataSources.Item("@ZTV_LINES").SetValue("U_Dscript", i, ""));
}
oMatrix.LoadFromDataSource();
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
}
Hope this help you
Regards
Arun
if ((pVal.ItemUID == "matrixid") && (pVal.ColUID == "columnid"))
{
oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx_0").Specific;
SAPbouiCOM.DBDataSource db0 = (SAPbouiCOM.DBDataSource)(oForm.DataSources.DBDataSources.Item("@YOURPOSITIONTABLE"));
val = oDataTable.GetValue("ItemCode", 0).ToString();
desc = oDataTable.GetValue("ItemName", 0).ToString();
db0.SetValue("U_dbfield1", pVal.Row - 1, val);
db0.SetValue("U_dbfield2", pVal.Row - 1, desc);
oMatrix.LoadFromDataSource();
oMatrix.AutoResizeColumns();
if (oForm.Mode == SAPbouiCOM.BoFormMode.fm_OK_MODE)
{
oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Try this
ItemUID == "colItemCod" || sCflId.ToString() == "CFL_5")
{
try
{
SAPbouiCOM.Matrix oMatrix;
int i = pVal.Row;
oMatrix = (SAPbouiCOM.Matrix)forma.Items.Item("matrix1").Specific;
forma.DataSources.DBDataSources.Item("@ZTV_LINES").Clear();
oMatrix..FlushToDataSource()
forma.DataSources.DBDataSources.Item("@ZTV_LINES").SetValue("U_ItemCode", 0, System.Convert.ToString(oDataTable.GetValue("ItemCode", 0)));
forma.DataSources.DBDataSources.Item("@ZTV_LINES").SetValue("U_Dscript", 0, System.Convert.ToString(oDataTable.GetValue("ItemName", 0)));
oMatrix.LoadFromDataSource()
if(i == oMatrix.RowCount)
{
oMatrix.AddRow(1, 0);
}
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
}
Hope this helps you
Regards
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.