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

Get the id of radcombo in the InitializeCulture code

3 Answers 82 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Sai Prashad Patro
Top achievements
Rank 1
Sai Prashad Patro asked on 08 Sep 2008, 09:02 AM
Hi,

How can i get the ID of a radcombo in the InitilizeCulture() method.

I have to change the text of the page according to the culture. But the culture is changing from the radcombo. After selecting the culture form radcombo i have to get the value to so that i can change.
But the radcombo id is not coming.

in code i have written as

protected override void InitializeCulture()

{

string strLanguage = Request["DropDownList1"];

Session[

"lang"] = strLanguage;

Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture(Session["lang"].ToString());

Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Session["lang"].ToString());

}

but it is showing error because  strLanguage is getting value of "null"
How can i get the control

Thanks,
Sai

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 08 Sep 2008, 11:26 AM
Hi Sai Prasad Patro,

Unfortunately you cannot use this code to obtain the currently selected item from RadComboBox as opposed to using a regular DropDownControl. Please try this code as a workaround:

IDictionary state = (IDictionary) new JavaScriptSerializer().DeserializeObject(Request[RadComboBox1.ClientStateFieldID]);
string comboText = (string)state["text"];


Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Sai Prashad Patro
Top achievements
Rank 1
answered on 09 Sep 2008, 11:47 AM
Hi Albert,

Thanks for suggetion.
But i am not getting the result still.
Think is that, "JavaScriptSerializer"  this one is obsolete it is showing in visualstudio.
i am using .net framework 3.5

Thanks,
Sai
0
Atanas Korchev
Telerik team
answered on 09 Sep 2008, 12:29 PM
Hello Sai Prasad Patro,

This should work in 3.5 as well. What exactly is the problem? Is the IDictionary filled with any data? Does Request[RadComboBox1.ClientStateFieldID] return anything?

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ComboBox
Asked by
Sai Prashad Patro
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Sai Prashad Patro
Top achievements
Rank 1
Share this question
or