Grid - Picture or Color at row/cell
Marcel Kieboom
Hi there,I've seen several topics on Grid / Matrixes on forms, however I did not find the right answer.
Through Coresuite I created a Grid which is filled through the ExecuteQuery however for creating more insight I want to color rows or text within rows based on the value of 1 column.
Is there anything possible with the PictureBoxGridColumn or something else to color a grid?
Kind regards,
Marcel
Anders Olsson
Hi Marcel,As far as I know, it's only possible to colour a grid column, not a row or individual cells:
[CODE]
((TextEditGridColumn)grid.Columns["ItemCode"].SpecificGridColumn).BackgroundColor = System.Drawing.Color.Red;
[/CODE]
Regards,
Anders
Paolo Manfrin
Hi Marcel,as far as I know this functionality should be provided in SAP Business One 8.82.
Kind Regards,
paolo
Emmanuel Bachellard
Hi guys,
Any update on this topic?
I created an "available to promise " specific grid and I would like to colour my value in red if the available is <0
Paul Witmond
Hi,
Please try this :
SAPbouiCOM.Form oSapForm = SwissAddonFramework.B1Connector.GetB1Connector().Application.Forms.ActiveForm;
SAPbouiCOM.Item oItem = oSapForm.Items.Item("Grd_1");
SAPbouiCOM.Grid oGrid = (SAPbouiCOM.Grid)oItem.Specific;
oGrid.RowHeaders.Width = 20;
oGrid.CommonSetting.SetRowBackColor(1, 65535);
oItem = oSapForm.Items.Item("Grd_2");
oGrid = (SAPbouiCOM.Grid)oItem.Specific;
oGrid.RowHeaders.Width = 20;
oGrid.CommonSetting.SetRowBackColor(1, 9806399);
This works from 8.82 patch 6 and above
Emmanuel Bachellard
Thank you Paul,
This function is working:
oGrid.CommonSetting.SetRowBackColor(1, 65535); ==> line 1 , colour Yellow
I am also able to colour a cell
oGrid.CommonSetting.SetCellBackColor(3, 2, 9806399); ==> row 3, column 2, colour green
Know I will try to find out how to link that with a if statement (check when my cell is <0)....
Please sign in to leave a comment.
Comments
0 comments