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