SAP 8.81 SDK Matrix 与Grid 如何实现对cell设定颜色及只读属性
SBO 8.81 可以实现对Matrix 与Grid 如何实现对cell设定颜色及只读属性
通过SAPbouiCOM.CommonSetting可以对Cell来设定。
oMatrix = (SAPbouiCOM.Matrix)(oForm.Items.Item("mtx").Specific);
SAPbouiCOM.CommonSetting oCommonSetting = oMatrix.CommonSetting;
for (int i = 1; i <= oMatrix.RowCount; i++)
{
if (Common.ConvertHelper.ToDateTime(((SAPbouiCOM.EditText)(oMatrix.Columns.Item(8).Cells.Item(i).Specific)).String) < System.DateTime.Now)
{
oCommonSetting.SetCellFontColor(i, 8, Common.Common.ColorTranslatorToOle(System.Drawing.Color.Red));
}
}
SAPbouiCOM.CommonSetting oCommonSetting = oMatrix.CommonSetting;
for (int i = 1; i <= oMatrix.RowCount; i++)
{
if (Common.ConvertHelper.ToDateTime(((SAPbouiCOM.EditText)(oMatrix.Columns.Item(8).Cells.Item(i).Specific)).String) < System.DateTime.Now)
{
oCommonSetting.SetCellFontColor(i, 8, Common.Common.ColorTranslatorToOle(System.Drawing.Color.Red));
}
}
以上代码实现对Cell颜色区分。
详情见SDK
Public Methods
![]() | Returns the background color of a cell in a matrix or a grid. |
![]() | Returns the information as to whether a cell is editable. |
![]() | Returns the font color of a cell in a matrix or a grid. |
![]() | Returns the font size of a cell in a matrix or a grid. |
![]() | Returns the font style of a cell in a matrix or a grid. |
![]() | Merge cells in a row, from the first one you want until the last one you want. The text displayed in a merged cell is the content from the first cell. |
![]() | The separation line between two rows. |
![]() | Updates the background color of a cell in a matrix or a grid. |
![]() | Sets the flag for whether a cell is editable. |
![]() | Updates the font color of a cell in a matrix or a grid. |
![]() | Updates the font size of a cell in a matrix or a grid. |
![]() | Updates the font style of a cell in a matrix or a grid. |
![]() | Updates the background color of a row in a matrix or a grid. |
![]() | Sets the flag for whether a row is editable. |
![]() | Updates the font color of a row in a matrix or a grid. |
![]() | Updates the font size of a row in a matrix or a grid. |
![]() | Updates the font style of a row in a matrix or a grid. |