How to rename a worksheet in RadSpreadsheet in Winforms

1 Answer 134 Views
Spreadsheet
Doug
Top achievements
Rank 1
Doug asked on 02 Sep 2021, 02:36 PM

Hello,

I am doing the following to rename a worksheet:

                Worksheet workSheet = sheetReturns.SpreadsheetElement.Workbook.Sheets.Add(SheetType.Worksheet) as Worksheet;
                workSheet.Name = "Missing Top 100";
                dtProvider.Import(_missingTop100, workSheet);
                sheetReturns.SpreadsheetElement.Workbook.ActiveWorksheet = workSheet;
                workSheet.Columns[workSheet.UsedCellRange].AutoFitWidth();

The new name of the sheet does not show unless another worksheet is added or I double click on the worksheet tab.

How can I code this so the new name shows immediately?

Thanks,
Doug

 

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 03 Sep 2021, 09:48 AM

Hello, Doug,

It seems that you hit a known issue which fix is expected to be released in the upcoming R3 2021 scheduled for the middle of September. Here is the feedback item for your reference:

https://feedback.telerik.com/winforms/1384925-changing-sheet-name-at-runtime-doesn-t-update-name

Meanwhile, feel free to use the suggested solution with using the RenameSheetCommand

//make active the sheet that you want to rename
this.radSpreadsheet1.ActiveSheet = this.radSpreadsheet1.Workbook.Sheets[1];
this.radSpreadsheet1.SpreadsheetElement.SheetSelector.RenameSheetCommand.Execute("new name")

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Spreadsheet
Asked by
Doug
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or