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

[Solved] Multiple language support for grids

1 Answer 193 Views
Grid
This is a migrated thread and some comments may be shown as answers.
BOS
Top achievements
Rank 1
BOS asked on 15 Mar 2010, 01:04 PM
I'm looking for an easy way to loop thru and address all texts in a grid to create multiple language support by fetching texts in users language from DB:
- AddNewRecordText in CommandItemSettings
- CancelText, UpdateText and InsertText in EditColumn
- EditText in GridEditCommandColumn
and HeaderText in all columns.

For all other controls on the page, I loop thru the controls like this: 
    protected void Page_PreRender(object sender, EventArgs e)
    {
        foreach (Control ctrl in Page.Controls)
        {
            findCtrl(ctrl);
        }
    }

    protected void FormView_DataBound(object sender, EventArgs e)
    {
        foreach (Control ctrl in FormView.Controls)
        {
            findCtrl(ctrl);
        }
    }

    public void findCtrl(Control ctrlTry)
    {
        if (ctrlTry.HasControls()) // if the control contrains other controls
        {
            if (ctrlTry.ID != null && ctrlTry.ID != "") // control has a ID-name
            {
                Response.Write(ctrlTry.ID + "<BR>");
            }

            foreach (Control lastCtrl in ctrlTry.Controls)
            {
                findCtrl(lastCtrl);
            }
        }
        else
        {
            if (ctrlTry.ID != null && ctrlTry.ID != "")
            {
                Response.Write(ctrlTry.ID + "<BR>");

            }
        }
    }
and use the controls ID to fetch the text from the DB.
But this approach doesn't work on texts in a grid.

Any ideas for multiple language support in grids using lookup i DB?

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 18 Mar 2010, 09:03 AM
Hi,

To see more information along the lines of the requested functionality, please refer to the following topic:

http://www.telerik.com/help/aspnet-ajax/grdlocalizationforgridheaders.html

This topic is part of the Localization/Accessibility section, which contains information on localizing all sections of the control, in different ways.
I hope this gets you started properly.

Kind regards,
Yavor
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
BOS
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or