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
GetCellBackColor | Returns the background color of a cell in a matrix or a grid. |
GetCellEditable | Returns the information as to whether a cell is editable. |
GetCellFontColor | Returns the font color of a cell in a matrix or a grid. |
GetCellFontSize | Returns the font size of a cell in a matrix or a grid. |
GetCellFontStyle | Returns the font style of a cell in a matrix or a grid. |
MergeCell | 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. |
SeparateLine | The separation line between two rows. |
SetCellBackColor | Updates the background color of a cell in a matrix or a grid. |
SetCellEditable | Sets the flag for whether a cell is editable. |
SetCellFontColor | Updates the font color of a cell in a matrix or a grid. |
SetCellFontSize | Updates the font size of a cell in a matrix or a grid. |
SetCellFontStyle | Updates the font style of a cell in a matrix or a grid. |
SetRowBackColor | Updates the background color of a row in a matrix or a grid. |
SetRowEditable | Sets the flag for whether a row is editable. |
SetRowFontColor | Updates the font color of a row in a matrix or a grid. |
SetRowFontSize | Updates the font size of a row in a matrix or a grid. |
SetRowFontStyle | Updates the font style of a row in a matrix or a grid. |