Unplanned
Last Updated: 03 Feb 2019 12:25 by Ioannis
Ioannis
Created on: 26 Jan 2019 23:05
Category: Spreadsheet
Type: Bug Report
1
Changing Sheet name at Runtime doesn't update name

Hello,

 

So here's what happens. I create a workbook and a worksheet in that wb which I assign as the workbook of a RadSpreadSheet by RadSpreadSheet..Workbook = wb

The first time I assign a name to the first (and only sheet) created in the creation of the wb, the name does appear on that sheet.

Then some code takes this workbook ByVal, creates a new Sheet, makes that sheet the wb's ActiveWorksheet and then changes the ws's name.

You can see in the debugging that the worksheet does have the new name i put there ("2018-05"), but visually this 2nd worksheet has the default name "sheet 2".

Then that wb which is returned by the function is assigned as the RadSpreadSheet's workbook

If I run the code again, so a 3rd sheet is created, then the 3rd sheet will visually have the default name "sheet 3", however in the debugger it says "2018-06" as its name; but most importantly, now sheet 2 has magically changed to what I was seeing its name to be in the debugger ("2018-05").

 

I'm assuming that If I'm changing the sheet names at runtime, I need to call some method on the Workbook element or something like that in order to update the names. I just couldn't find which method to call.

 

Best regards,

Ioannis Mamalikidis.

3 comments
Ioannis
Posted on: 03 Feb 2019 12:25
Thank you, that worked perfectly :)
ADMIN
Dess | Tech Support Engineer, Sr.
Posted on: 31 Jan 2019 12:04
Hello, Ioannis,       

Please excuse us for the delay in our reply. I have strictly followed the described steps and I was able to replicate the problem with the sheet's name on my end. I have logged it in our feedback portal by making this thread public. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

I have also updated your Telerik points.

Currently, the possible solution that I can suggest is to use the following code snippet: 

//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, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
ADMIN
Tanya
Posted on: 30 Jan 2019 22:38
Hi Ioannis,

Such changes should be respected by the UI and this behavior seems like an issue in the control. I am transferring this case to the responsible team so they can check if they can provide you with a workaround for this issue.

Regards,
Tanya
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.