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

RadInputManager and Culture

1 Answer 36 Views
Input
This is a migrated thread and some comments may be shown as answers.
aehlert
Top achievements
Rank 1
Veteran
aehlert asked on 10 May 2013, 07:49 PM

I am trying to figure out a way to change the culture attribute of items being loaded thru the RadInputManager.

I'm using the methods I've found on the site to build the RadInputManager when a page is loaded.

I use the Page_Init to add settings:

protected void Page_Init(object sender, EventArgs e)
{
    NumericTextBoxSetting numericSetting = new NumericTextBoxSetting();
    numericSetting.Validation.IsRequired = false;
    numericSetting.BehaviorID = "numeric";
    numericSetting.InitializeOnClient = true;
    RadInputManager1.InputSettings.Add(numericSetting);
 
    NumericTextBoxSetting _currencySetting = new NumericTextBoxSetting();
    _currencySetting.BehaviorID = "currency";
    _currencySetting.DecimalDigits = 2;
    _currencySetting.Type = NumericType.Currency;
    _currencySetting.Validation.IsRequired = false;
    _currencySetting.InitializeOnClient = true;
    RadInputManager1.InputSettings.Add(_currencySetting);
 
}

And apply it like:

TextBox _txtTotal = (TextBox)e.Item.FindControl("txtTotal");
RadInputManager1.InputSettings[1].TargetControls.Add(new TargetInput(_txtTotal.UniqueID, true));

This works like a charm.  I want to change the culture of the rendered controls based on selections that the user places on the screen.  I can't do it on the Page_Init, however, because the data is not available at the time.

Is there a way to change the culture after I've used the Page_Init to build the controls?

1 Answer, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 14 May 2013, 07:30 AM
Hello,

The way suggested by Microsoft for dynamically changing the culture is by overriding the InitializeCulture. By that time you will need to access the value chosen by your user directly from the Request.Form. Here their documentation with example code:
http://msdn.microsoft.com/en-us/library/bz9tc508%28v=vs.100%29.aspx

Kind regards,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Input
Asked by
aehlert
Top achievements
Rank 1
Veteran
Answers by
Vasil
Telerik team
Share this question
or