Hi Carlos,
Thanks for contacting Syncfusion support.
You can define the named ranges in the Spreadsheet by using
the following code snippet.
Code Snippet[C#]:
this.spreadSheetControl.WorkBookLoaded += spreadSheetControl_WorkBookLoaded; void spreadSheetControl_WorkBookLoaded(object sender, WorkbookLoadedEventArgs args) { IWorkbook workbook = this.spreadSheetControl.ExcelProperties.WorkBook; GridControl grid = this.spreadSheetControl.GridProperties.ActiveSpreadsheetGrid; IName name1 = workbook.Names.Add("FIRSTCELL"); name1.RefersToRange = workbook.ActiveSheet.Range["A1"]; grid.Model.FormulaEngine.AddNamedRange(name1.Name, name1.Value); }
|
We have prepared a sample based on this and you can find the
sample from the below location.
Please let us know if you have any other queries.
Regards,
Pannir
SpreadsheetDemo_WPF_39cd6eb2.zip