Reputation: 677
Is it possible to do this on one line? dataRange.Style.Border.SetInsideBorder(XLBorderStyleValues.Thin).SetOutsideBorder(XLBorderStyleValues.Thin) isn't correct syntax
dataRange.Style.Border.SetInsideBorder(XLBorderStyleValues.Thin)
dataRange.Style.Border.SetOutsideBorder(XLBorderStyleValues.Thin)
Upvotes: 0
Views: 345
Reputation: 74660
Looking at the code it seems to have some sort of fluent syntax in that SetXxxBorder returns a Style. I'd hence be interested to know if this works:
dataRange.Style.Border.SetOutsideBorder(...).Border.SetInsideBorder(...);
You also have vb.net's statement separator:
Dim t = XLBorderStyleValues.Thin : Dim b = dataRange.Style.Border : b.InsideBorder = t : b.OutsideBorder = t
If you're using eg Thin border a lot it would reduce wordiness to declare it elsewhere (like I did with t
) using a reasonably descriptive but shorter name
Upvotes: 0
Reputation:
Try this:
dataRange.Style.Border.SetInsideBorder(XLBorderStyleValues.Thin) : dataRange.Style.Border.SetOutsideBorder(XLBorderStyleValues.Thin)
Upvotes: 1