Can we copy a row from excel sheet to another excel sheet, keeping all the cell validations and formatting ?
Like,
NewWorkSheets[0].Rows[0] = WorkSheets[0].Rows[0];
Or do I have to do it manually ? copy value from each cell and all ???
Hello Vaishvnavi,
Thank you for posting in the community.
By design Rows collection of is a read only collection which means that values could not be assigned to items from this collection.
What I can suggest for achieving your requirement is is manually setting cell values. For example:
voWBook.Worksheets[1].GetCell("A1").Value = voWBook.Worksheets[0].GetCell("A1").Value;
I also made a small sample illustrating my suggestion and I am attaching it for your reference.
Some further reference about Infragistics Excel Engine could be found at:
http://help.infragistics.com/doc/ASPNET/2014.2/CLR4.0/?page=ExcelEngine_Using_the_Infragistics_Excel_Engine.html
Please let ne know if you need any further assistance with this matter.
Hi, Thank you for the help.
But I have few validations and cell formatting. So I have to do that also similar to this ?
voWBook.Worksheets[1].GetCell("A1").DataValidationRule= voWBook.Worksheets[0].GetCell("A1").DataValidationRule;
It would be nice if we could add the entire row at once.
Isnt that possible now ?