on 01-22-2013 11:55 AM
Hi All,
I have created a matrix with a column type Picture box and I was trying to add a image (.gif, .bmp, .png) to this particular column
((SAPbouiCOM.PictureBox)matrix.Columns.Item("V_5").Cells.Item(i).Specific).Picture = Environment.CurrentDirectory + "\\1.bmp";
The code is not working and the column is empty.
I just wanted to confirm if this is supported by SDK or do I need to do something else?
Cheers
David
Hi David,
Is the column bound?
Here is a sample:
Form f = B1Connections.theAppl.Forms.Add("test", BoFormTypes.ft_Sizable, 999);
f.Width = 500;
f.Height = 500;
f.Top = 100;
f.Left = 50;
Item i = f.Items.Add("matrix", BoFormItemTypes.it_MATRIX);
i.Width = 498;
i.Height = 498;
Matrix m = i.Specific as Matrix;
DataTable dt = f.DataSources.DataTables.Add("data");
m.Columns.Add("#", BoFormItemTypes.it_EDIT);
m.Columns.Add("name", BoFormItemTypes.it_EDIT);
m.Columns.Add("pic", BoFormItemTypes.it_PICTURE);
dt.Clear();
dt.Columns.Add("name", BoFieldsType.ft_AlphaNumeric, 254);
dt.Columns.Add("pic", BoFieldsType.ft_AlphaNumeric, 254);
m.Columns.Item("name").DataBind.Bind("data", "name");
m.Columns.Item("pic").DataBind.Bind("data", "pic");
dt.Rows.Add();
dt.SetValue("name", 0, @"C:\Chrysanthemum.jpg");
dt.SetValue("pic", 0, @"C:\Chrysanthemum.jpg");
m.LoadFromDataSource();
f.Visible = true;
Good luck.
Best regards,
Pedro Magueija
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.