We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Remove Cells e move content to RIght

Hi,

I'm trying to make a deletion/insertion of a cell.

But i need to perform a action like Excel.

Before add/remove, i need to shift cells to right or left, depends on user's choice. To add/remove columns, i used

this.Model.Data.InsertCols(index, colsToAdd);
this.Model.Data.InsertRows(index, colsToAdd);

E.g. When i delete a cell, i need to move the left content to right.
For example, i have a A1, A2 and A3 cells. If i remove A2 i need to move A3 content to A2 place.

There's a built in method to do this?

Thanks.


1 Reply

SR Sridhar Syncfusion Team April 13, 2012 09:14 AM UTC

Hi Fabio,

Thank you for using Syncfusion products.

In Essential XlsIO, currently we do not have support for shift the cells available in MS Excel.We have support to shift the entire row/column (by insert/delete row/column).

However, we have the support to move the cell content from one cell to another cell in XlsIO. Please use the MoveTo(IRange) method available with XlsIO.

Code Snippet [C#]:

//Moves the A3 cell content to cell A2 and replaces it

sheet.Range["A3"].MoveTo (sheet["A2"]);

We have created the sample for the same at our side and attached here for your reference. Please try the sample and let us know if this helps you.


Please let me know if you require any further clarifications.


Thanks,
Sridhar.S





MoveCell_677561fc.zip

Loader.
Live Chat Icon For mobile
Up arrow icon