I'm trying to setup "non modifiable" column headers so that users can cut/paste or edit to provide values on worksheets. I have successfully set the first row to Frozen, but I also want to protect the cells that contains the column headers so that users cannot modify or delete the cells, but the following code does not work.
worksheet = project.MyWorkbook.Worksheets.Add("historical_injectivity.txt");worksheet.Protected = true;for (int i = 0; i < 2.Count; i++) { worksheet.Rows[0].Cells[i].CellFormat.Locked = ExcelDefaultableBoolean.True; }
Can you offer any help?
Hello,
I am just checking if you require any further assistance on the matter.
Hi Michael,
Thank you for your post. I have been looking into your concerns and currently this functionality is implemented only on Workbook level. It means that it is not implemented to work when loading the work book in XamSpreadsheet control. This feature will be implemented to our next version of the product(vol. 15.1).
The desired behavior could be easily achieved by handling the ‘EditModeEntering’ event of the XamSpreadsheet control and cancelling it for the first row(header row) of the work sheet like e.g.:
private void xamSpreadsheet1_EditModeEntering(object sender, Infragistics.Controls.Grids.SpreadsheetEditModeEnteringEventArgs e)
{
if (e.Cell.Row == 0)
e.Cancel = true;
}
Let me know, if you need any further assistance on this matter.