此文档主要介绍了通过Spread组件模拟网页Excel效果,并可以实现一些简单的样式设置。
//设置指定区域的背景色。foreColor为前台传回的颜色。如Black、red等等
string foreColor = e.CommandName.Substring(10);
FpSpreadText.ActiveSheetView.Cells[rowindex, columnindex, rowFarthestIndex, columnFarthestIndex].ForeColor = Color.FromName(foreColor);
}
#endregion
#region 单元格背景色,方法同设置字体颜色
if (cellBackColor.Success)
{
string backColor = e.CommandName.Substring(10);
FpSpreadText.ActiveSheetView.Cells[rowindex, columnindex, rowFarthestIndex, columnFarthestIndex].BackColor = Color.FromName(backColor);
}
#endregion
设置单元格的边框颜色,此方法组件提供的BorderColor属性实现,但是当
给区域添加边框颜色是不好使,应该是组件本身的bug,下面是自己写的方法 #region
if (cellBorderColor.Success)
{
string borderColor = e.CommandName.Substring(12);
//选中的都是一行的单元格
if (rowindex == rowFarthestIndex)
{
//只有一个单元格时设置边框
if (columnindex == columnFarthestIndex)
{
FarPoint.Web.Spread.Border oneCellBorder = new FarPoint.Web.Spread.Border();
oneCellBorder.BorderColorLeft = System.Drawing.Color.FromName(borderColor);
oneCellBorder.BorderColorTop = System.Drawing.Color.FromName(borderColor);
oneCellBorder.BorderColorBottom = System.Drawing.Color.FromName(borderColor);
oneCellBorder.BorderColorRight = System.Drawing.Color.FromName(borderColor);
oneCellBorder.BorderStyleTop = BorderStyle.Solid; //~~~~~~~~~~~~~~~~~~~~~~~~~~ oneCellBorder.BorderStyleBottom = BorderStyle.Solid; //~~~~~~~~~~~~~~~~~~~~~~~~~~ oneCellBorder.BorderStyleLeft = BorderStyle.Solid; //~~~~~~~~~~~~~~~~~~~~~~~~~~ oneCellBorder.BorderStyleRight = BorderStyle.Solid; //~~~~~~~~~~~~~~~~~~~~~~~~~~
FarPoint.Web.Spread.Cell cOneCell;
cOneCell = FpSpreadText.ActiveSheetView.Cells[rowindex, columnindex];
cOneCell.Border = oneCellBorder;
}
else
{
//头上单元格边线样式
FarPoint.Web.Spread.Border borderTop = new FarPoint.Web.Spread.Border();
borderTop.BorderColorBottom = System.Drawing.Color.FromName(borderColor);
FarPoint Spread控件使用_计算机软件及应用_IT/计算机_专业资料。FarPoint Spread WinForm交替背景色 grid1.BackColorStyle = 1 ret = grid1.SetOddEvenRowColor(...
//gcdn.grapecity.com Spread 产品介绍 13 2.2 基本功能介绍 Spread 支持导入和导出 Microsoft Excel 格式的文件,支持 PDF 导出,支持多工作表、跨工作表 公式...
Spread 基本知识(一) ---1 取得当前行号,列号.int row=e.Row; int count=e.Count; 或者: int rowindex = fpSpread1.ActiveSheet.ActiveRowIndex; int column...
FarPoint.Win.Spread.InputMap im; //spdResult是你画面中定义的spread的名字...["基本剂量"] = myItem.BaseDose.ToString(); row["剂量单位"] = myItem...
//gcdn.grapecity.com Spread 产品介终 13 2.2 基本功能介绍 Spread for ...单元格操作 3.1 设置单元格类型 Spread 5 for ASP.NET 支持 16 种单元格...
FarPoint.Win.Spread.InputMap im; //spdResult是你画面中定义的spread的名字...["基本剂量"] = myItem.BaseDose.ToString(); row["剂量单位"] = myItem...
通过设计器(Spread Designer)可以设置 Spread、Sheet、Selected Item 三种 对象的属性,以设计出所需的报表。使用方式是 将该控件拖到窗体中。 如果需要进行数据绑定...
Farpoint使用基础_计算机软件及应用_IT/计算机_专业资料。C#使用spread...["基本剂量"] = myItem.BaseDose.ToString(); row["剂量单位"] = myItem...
FarPoint.Win.Spread.InputMap im; //spdResult是你画面中定义的spread的名字...["基本剂量"] = myItem.BaseDose.ToString(); row["剂量单位"] = myItem...
FarPoint.Win.Spread.InputMap im; //spdResult是你画面中定义的spread的名字...["基本剂量"] = myItem.BaseDose.ToString(); row["剂量单位"] = myItem...
热门文档