Quantcast
Channel: NPOI
Viewing all articles
Browse latest Browse all 1621

Created Unassigned: Weird behavior when locking cells NPOI 2.0.6 [13199]

$
0
0
I spotted a weird behavior when trying to lock some cells with NPOI. Using global cell styles I can only generate an excel sheet with all cells blocked or all cells editable. The __ProtectSheet()__ method seems to override the __IsLocked__ attribute when using global cell styles some times.
The workaround I found is defining a style for each cell, but excel has a limit on cell styles per sheet, so this is not a good way of doing this.

I've created a pastebin with the method:
* Problem: http://pastebin.com/xt9a5A8A
* Workaround http://pastebin.com/CthHNSvs

I've tried to move those lines of code up and down, protect the sheet in different moments and also set cell styles in different places of the code. I'd like to know if there is another way of doing this kind of work with NPOI or if this is a cataloged issue or something like that. Thank you.

Viewing all articles
Browse latest Browse all 1621

Trending Articles



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