Hi there
I am exporting a Grid in Biff Format which is successfully exporting - however I want to allow the user to be able to change values in one column only (e.g column 3)
If the user attempts to changes any other columns they would get a warning from Excel advising them the cell is protected.
I believe this can be done in the "ExcelMLWorkBookCreated" but am not sure what the code needs to be so it can loop through all the columns - below is what I have so far....
Any help much appreciated....
protected void gridPricing_ExportToExcel_ExcelMLWorkBookCreated(object sender, Telerik.Web.UI.GridExcelBuilder.GridExcelMLWorkBookCreatedEventArgs e) { e.WorkBook.Worksheets[0].IsProtected = true; StyleElement protectionStyle = new StyleElement("ProtectionStyle"); protectionStyle.CellProtection.IsProtected = false; e.WorkBook.Styles.Add(protectionStyle); foreach (ColumnElement column in e.WorkBook.Worksheets[0].Table.Columns) { int columnindex = e.WorkBook.Worksheets[0].Table.Columns.IndexOf(column); if (columnindex == 3) { //code NEEDED in here needs to loop through cells or columns //and get cellelement or columnelement // so I can set the cell.stylevalue for this column } }