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

Localizing Edit Form Labels?

3 Answers 71 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bruce Parr
Top achievements
Rank 1
Bruce Parr asked on 07 Sep 2010, 06:52 PM
All,

Is there a way to localize the labels within an auto-generated edit form? I would prefer not to have to use a web control to do this if at all possible. I have managed to assign resource file values to the grid headers easily enough, but I do not want to use the same value for the grid headers and the edit form.

Thanks,
jax

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 08 Sep 2010, 07:10 AM
Hello Jax,


Customizing the edit-form header achieved by the setting the 'EditFormHeaderTextFormat' as per the requirement.
<telerik:GridBoundColumn DataField="City" HeaderText="City" SortExpression="City"
    UniqueName="City" EditFormHeaderTextFormat="Your City" >
</telerik:GridBoundColumn>

Declarative style editors

-Shinu.
0
Bruce Parr
Top achievements
Rank 1
answered on 08 Sep 2010, 12:08 PM
Hi Shinu,

Thanks for your reply. I think I was on the right track, but I was put off by the EditFormHeaderTextFormat name. Next question...How do I set this from code? I am using the following code:

foreach (Telerik.Web.UI.GridColumn gridColumn in rgCompany.MasterTableView.Columns)
{
    gridColumn.EditFormHeaderTextFormat = Localization.GetString("GridHeader" + gridColumn.UniqueName + ".Text", LocalResourceFile);
}

I have tried this in both the ItemDataBound and ItemDataCreated events, and while it does not throw exceptions, I am not seeing my updated code. Is there some other event where I need to put this?

Thanks,
jax
0
Bruce Parr
Top achievements
Rank 1
answered on 08 Sep 2010, 12:14 PM
Hi Shinu,

I got it. I moved the code to the PreRender event and it appears as expected.

Thanks,
jax
Tags
Grid
Asked by
Bruce Parr
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Bruce Parr
Top achievements
Rank 1
Share this question
or