I am binding data to spreadsheet.Can I make spreadsheet non editable?
I want something like as below
this.spreadsheet.workbook.worksheets(0).Editable=False:
User should not able to edit excel sheet.User can only see excel in read mode.
Can you please help me
Hello,
I have been looking into your question and an approach I could suggest is to mark the worksheet as protected. This could be done via the protect method. More about configuring protection as well as a small demo that you might consider useful could be found in this topic in our documentation.
Let me know if I may be of any further assistance.Sincerely,Teodosia HristodorovaSoftware Developer
Thanks for the quick response.
I have one more question. Can I delete particular rows from spreadsheet as below
this.spreadsheet.workbook.worksheets(0).DeleteRow(0,2);
I have determined that a method that could be used in order to achieve a similar functionality is the deleteCells method. It could take as a parameter a particular address or a region to delete.
Let me know if I may be of any further assistance.
Sincerely,Teodosia HristodorovaSoftware Developer
Thanks a lot for you reply. If I want to delete first two rows of a worksheet how should I do that? Can you please give me a code for that.
I am glad that you find my suggestion helpful.
Thank you for using Infragistics components.
Regards,Teodosia HristodorovaSoftware Developer
Thanks for the reply.Sure next time I will raise question in separate thread
Hello,A possible approach using the deleteCells method would be to create a WorksheetRegion with all cells in the required rows and pass this region as a parameter of the method as follows:
public delete() { const ws = this.spreadsheet.workbook.worksheets(0); const maxColIndex = ws.columns().maxCount - 1; let region = new WorksheetRegion(ws, 0, 0, 1, maxColIndex); ws.deleteCells(region, false); }
If you require any further assistance on the matter, please let me know.