Help with translation

4 posts, 0 answers
  1. Paulo
    Paulo avatar
    10 posts
    Member since:
    May 2014

    Posted 30 Jan 2015 Link to this post


    I need to know the name of the attributes to translate the sheet name and the workbook, as highlighted in the attachment.
  2. Tanya
    Admin
    Tanya avatar
    404 posts

    Posted 02 Feb 2015 Link to this post

    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.

     
  3. DevCraft banner
  4. Paulo
    Paulo avatar
    10 posts
    Member since:
    May 2014

    Posted 02 Feb 2015 in reply to Tanya Link to this post

    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.
  5. Tanya
    Admin
    Tanya avatar
    404 posts

    Posted 03 Feb 2015 Link to this post

    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.

     
Back to Top