This is a migrated thread and some comments may be shown as answers.

Help with translation

3 Answers 51 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Paulo
Top achievements
Rank 1
Paulo asked on 30 Jan 2015, 06:05 PM

I need to know the name of the attributes to translate the sheet name and the workbook, as highlighted in the attachment.

3 Answers, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 02 Feb 2015, 01:41 PM
Hello Paulo,

These two strings come from the document loaded in the control and are not depending on the localization of the control, so you can freely set them to a desired value. In order to change the string holding the worksheet's name you can follow the Rename a Worksheet article. The snippet below demonstrates how to change the name of the workbook:
this.radSpreadsheet.Workbook.Name = "New Name";

Hope this helps.

Regards,
Tanya
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Paulo
Top achievements
Rank 1
answered on 02 Feb 2015, 02:32 PM
Hello Tanya,

I'm needing to change the default name of the worksheet when I just open the radSpreadsheet. As you said (your example)  if I create a new worksheet appears Sheet2.

I would like to open the radSpreadsheet and it was displayed the name translated.
0
Tanya
Telerik team
answered on 03 Feb 2015, 02:24 PM
Hello Paulo,

You can subscribe to the ActiveSheetChanged event of RadSpreadsheet. When the user adds new Worksheet, the ActiveSheet property is set to the newly added sheet. Using this approach, however, you should check if the name has been already changed.
private const string DefaultSheetName = "CustomSheet";
private int currentSheetNumber = 1;
 
void radSpreadsheet_ActiveSheetChanged(object sender, EventArgs e)
{
    if (this.radSpreadsheet.ActiveSheet.Name.StartsWith("Sheet"))
    {
        this.radSpreadsheet.ActiveSheet.Name = DefaultSheetName + this.currentSheetNumber;
        this.currentSheetNumber++;
    }
}

Please, let me know if you have any other questions.

Regards,
Tanya
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Spreadsheet
Asked by
Paulo
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Paulo
Top achievements
Rank 1
Share this question
or