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

Commented Unassigned: Not possible to unmerge in 4.0.1 [15134]

$
0
0
Dears,
It is no longer possible use Merge property to unmerge a range:

In version 4.0.1 (In ExcelRangeBase.cs):

> ExcelRange.Merge = false

has same effect as

> ExcelRange.Merge = true

Should there be other way how to unmerge? Or it is planned to be added? Or it is a bug?

Thank you

Meanwhile I have updated the setter of Merge property in my project to code below:

```
set
{
IsRangeValid("merging");
//SetMerge(value, FirstAddress);
if (!value)
{
if (_worksheet.MergedCells.Contains(FirstAddress))
{
_worksheet.MergedCells.Remove(FirstAddress);
}
else
{
throw (new ArgumentException("Range is not merged"));
}
if (Addresses != null)
{
foreach (var address in Addresses)
{
if (_worksheet.MergedCells.Contains(address.Address))
{
_worksheet.MergedCells.Remove(address.Address);
}
else
{
throw (new ArgumentException("Range is not merged"));
}
}
}
}
else
{
_worksheet.MergedCells.Add(new ExcelAddressBase(FirstAddress), true);
if (Addresses != null)
{
foreach (var address in Addresses)
{
_worksheet.MergedCells.Add(address, true);
//SetMerge(value, address._address);
}
}
}
}
```
Comments: ¿and how it solves the get? :)

Viewing all articles
Browse latest Browse all 2262

Trending Articles



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