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));
                        }
                    }

以上代码实现对Cell颜色区分。

  

详情见SDK

 

Public Methods

Public Method GetCellBackColor Returns the background color of a cell in a matrix or a grid.
Public Method GetCellEditable Returns the information as to whether a cell is editable.
Public Method GetCellFontColor Returns the font color of a cell in a matrix or a grid.
Public Method GetCellFontSize Returns the font size of a cell in a matrix or a grid.
Public Method GetCellFontStyle Returns the font style of a cell in a matrix or a grid.
Public Method 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.

Public Method SeparateLine The separation line between two rows.
Public Method SetCellBackColor Updates the background color of a cell in a matrix or a grid.
Public Method SetCellEditable Sets the flag for whether a cell is editable.
Public Method SetCellFontColor Updates the font color of a cell in a matrix or a grid.
Public Method SetCellFontSize Updates the font size of a cell in a matrix or a grid.
Public Method SetCellFontStyle Updates the font style of a cell in a matrix or a grid.
Public Method SetRowBackColor Updates the background color of a row in a matrix or a grid.
Public Method SetRowEditable Sets the flag for whether a row is editable.
Public Method SetRowFontColor Updates the font color of a row in a matrix or a grid.
Public Method SetRowFontSize Updates the font size of a row in a matrix or a grid.
Public Method SetRowFontStyle Updates the font style of a row in a matrix or a grid.
 

 

 

posted @ 2011-08-25 15:04  E.L.---黑者如斯夫,不舍昼夜......  阅读(908)  评论(0编辑  收藏  举报