Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

Commented Unassigned: borderstyle problem [9321]

$
0
0
Hello,

I have an issue, i'm working with MS Dynamics AX 2009.
I need to apply a border style, but the values for the XLBorderStyleValues enum aren't showing up.
I believe it should be like this:
```
style = cellrange.get_Style();
border = style.get_Border();
border.set_OutsideBorderColor(ClosedXML.Excel.XLColor::get_Black());
border.set_OutsideBorder(ClosedXML.Excel.XLBorderStyleValues.Thin);
```
but it won't let me compile and gives a syntax error.
I noticed that some methods weren't available in MS Dynamics AX compared to c# environment.

Thanks.
Comments: I found the solution. One of the limitation in IntelliSense in MS Dynamics is that it does not support auto displaying the .NET enumeration value. Luckily there is a useful method called ClrInterop::parseClrEnum(_clrEnumTypeName, _enumValues), which you can convert a string of the .NET enum value to a CLRInterop object. So my code is like this: ``` style = cellrange.get_Style(); border = style.get_Border(); borderstyle = ClrInterop::parseClrEnum('ClosedXML.Excel.XLBorderStyleValues', 'Thin'); border.set_OutsideBorderColor(ClosedXML.Excel.XLColor::get_Black()); ```

Viewing all articles
Browse latest Browse all 1877

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>