- this.FpSpread1.Sheets[0].FrozenRowCount = 2;
- this.FpSpread1.Sheets[0].FrozenColumnCount = 2;
在某些情况下,我们可能不需要交界处的边线加粗显示,而是与其它表格线显示一样的粗细,此时我们就的对SheetView拆分之后的<Table>进行一些特殊的样式设置,将viewport和viewport1的左边框隐藏,viewport和viewport2的上边框隐藏,而这一过程我们都放到Render中来实现,代码如下:
protected override void Render(HtmlTextWriter writer)
{
Table frozenTable1 = this.FpSpread1.FindControl("viewport1") as Table;
if (frozenTable1 != null)
{
frozenTable1.Style.Value = "border-bottom: Black 1px solid; position: " +
"relative; border-left: Black 0px solid; width: 1px; border-collapse:" +
" collapse; table-layout: fixed; border-top: Black 1px solid; top: 0px;" +
" cursor: default; border-right: Black 1px solid;";
}
Table frozenTable2 = this.FpSpread1.FindControl("viewport2") as Table;
if (frozenTable2 != null)
{
frozenTable2.Style.Value = "border-bottom: Black 1px solid; position: " +
"relative; border-left: Black 1px solid; width: 1px; border-collapse:" +
" collapse; table-layout: fixed; border-top: Black 0px solid; top: 0px;" +
" cursor: default; border-right: Black 1px solid;";
}
Table frozenTable = this.FpSpread1.FindControl("viewport") as Table;
if (frozenTable != null)
{
frozenTable.Style.Value = "border-bottom: Black 1px solid; position: " +
"relative; border-left: Black 0px solid; width: 1px; border-collapse:" +
" collapse; table-layout: fixed; border-top: Black 0px solid; top: 0px;" +
" cursor: default; border-right: Black 1px solid;";
}
base.Render(writer);
}
复制代码
源码下载:VS2010 + Spread for ASP.NET 6.0 + IE8.0