Quantcast
Channel: EPPlus Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 2262

Edited Unassigned: DataValidations "Remove" not working and not clearing count [15420]

$
0
0
The method "Remove" for DataValidations of a WorkSheet is not working and is throwing an exception that node is not a child node.

I think the issue is that following code:
```
TopNode.RemoveChild(((ExcelDataValidation)item).TopNode);
```
should be
```
TopNode.SelectSingleNode(DataValidationPath.TrimStart('/'), NameSpaceManager).RemoveChild(((ExcelDataValidation)item).TopNode);
```
as it is done in "RemoveAll" which is working fine.

Further when removing a DataValidation (template had one DataValidation that was removed) then the resulting sheet got corrupted because the XML still had ```<dataValidations count="1"/>```
which could be temporarily fixed by:
```
if ( dataValCollection.Count == 0 ) // workaround
dataValCollection.Clear();
```
after doing a remove.

Viewing all articles
Browse latest Browse all 2262

Trending Articles



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