找回密码
 立即注册

QQ登录

只需一步,快速开始

Quanweiz
初级会员   /  发表于:2023-3-16 13:01  /   查看:1369  /  回复:1
1金币
            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);

最佳答案

查看完整内容

这种目前只能设置内置的样式名称,比如 或者你自定义一个style,实现接口ITableStyle

1 个回复

倒序浏览
最佳答案
最佳答案
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2023-3-16 13:01:18
来自 2#
本帖最后由 Richard.Ma 于 2023-3-16 15:22 编辑

这种目前只能设置内置的样式名称,比如
  1.             tb2.TableStyleName = "TableStyleDark1";
复制代码


或者你自定义一个style,实现接口ITableStyle
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部