This project has moved and is read-only. For the latest updates, please go here.

InsertData shifting rows and styles

Jan 23, 2012 at 10:35 PM

Is there a way to use the InsertData method to shift rows & copy styles automatically? 

I'm using a template xlsx file with pre-defined named ranges/styles. A range, for example is just 1 row high but has styles in some of the columns (number, percent, etc.. styles). Before I call InsertData I Insert some new rows using InsertRowsAbove. However, the styling didn't get copied to the new rows (it's only on the 1st row). Is there a way to do this?


Jan 23, 2012 at 11:19 PM

The library mimics the behavior you get in Excel. If you insert a row it will copy the style from the row above. If you insert a row above the first one it will have the default style of the worksheet. If this is not the case then create a new issue on the Issue Tracker tab and attach your template and the code you're using.