通过下面这种方式绑定数据源时,能设置表格样式吗?
FarPoint.Win.Spread.Data.SpreadDataBindingAdapter data = new FarPoint.Win.Spread.Data.SpreadDataBindingAdapter();data.DataSource = dt;
data.Spread = fpSpread1;
data.SheetName = "参数设置";
data.MapperInfo = new FarPoint.Win.Spread.Data.MapperInfo(11, 2, dt.Rows.Count, dt.Columns.Count);
data.FillSpreadDataByDataSource();
通过上面这种方式绑定数据源时,能设置绑定区域的表格样式吗?如下面:
FarPoint.Win.ComplexBorderSide bside = new FarPoint.Win.ComplexBorderSide(System.Drawing.Color.FromArgb(189, 215, 238));
FarPoint.Win.Spread.TableBorder tborder = new FarPoint.Win.Spread.TableBorder(bside);
FarPoint.Win.Spread.TableElementStyle testyle = new FarPoint.Win.Spread.TableElementStyle(tborder, System.Drawing.Color.White, System.Drawing.Color.Black, FarPoint.Win.Spread.RegularBoldItalicFontStyle.NotSet);
FarPoint.Win.Spread.TableElementStyle testyle1 = new FarPoint.Win.Spread.TableElementStyle(tborder, System.Drawing.Color.FromArgb(226, 240, 217), System.Drawing.Color.Black, FarPoint.Win.Spread.RegularBoldItalicFontStyle.NotSet);
FarPoint.Win.Spread.TableStyle tstyle = fpSpread1.CreateTableStyle("Style1", FarPoint.Win.Spread.TableStyle.None);
tstyle.HeaderRow = testyle1;
tstyle.FirstRowStripe = testyle;
tstyle.SecondRowStripe = testyle;
//fpSpread1.TableStyleCollection.Remove("Style1");
fpSpread1.TableStyleCollection.Add(tstyle);
本帖最后由 Richard.Ma 于 2023-3-16 15:22 编辑
这种目前只能设置内置的样式名称,比如
tb2.TableStyleName = "TableStyleDark1";
或者你自定义一个style,实现接口ITableStyle
页:
[1]