How to set specific image properties in EPPlus?

May 13, 2014 at 2:25 PM

I try to insert images into a worksheet using the ExcelWorkSheet: Drawings.AddPicture. It all works fine except when I try to filter rows in excel. The inserted images will not disappear when the specific row is filtered.

The filtering works fine when I manually change the "Object positioning" (Size and Properties... -->Properties) to "Move and size with cells". I'm using Excel 2010 & EPPlus 3.1

Of course, I want this settings to be applied using EPPlus, but I don't know how. Who can help ?

Feb 17, 2015 at 10:52 PM
Try setting ExcelPicture EditAs property. Set it to eEditAs.TwoCell

pic.EditAs = eEditAs.TwoCell;
Here's how these properties are translated in excel Image properties
eEditAs.Absolute -> Don't move or size with cells
eEditAs.OneCell -> Move but don't size with cells
eEditAs.TwoCell -> Move and size with cells