
Mugdha Aditya
Top achievements
Rank 1
Mugdha Aditya
asked on 02 Aug 2011, 12:52 PM
I have dynamically created grid in my application in which one column is numaric one.
i want to change its formate accordinging to localization of machine.
eg. English US (en-US) locazlizaton on our machine , if want to write 100 number in US localization then we will write it as
1,00.00
if its Argentina Spanish (es-AR) localization then 1.00,00
like wise.
i want o use localization for that specific column. how to do that?
i want to change its formate accordinging to localization of machine.
eg. English US (en-US) locazlizaton on our machine , if want to write 100 number in US localization then we will write it as
1,00.00
if its Argentina Spanish (es-AR) localization then 1.00,00
like wise.
i want o use localization for that specific column. how to do that?
10 Answers, 1 is accepted
0

Jayesh Goyani
Top achievements
Rank 2
answered on 02 Aug 2011, 12:58 PM
Hello,
please check below link.
http://www.telerik.com/community/forums/aspnet/grid/change-radgrid-column-culture.aspx
http://www.telerik.com/community/forums/aspnet-ajax/grid/how-to-render-the-value-in-a-templated-radgrid-column-in-a-specific-culture-and-which-radgrid-event-to-do-this-in.aspx
http://www.telerik.com/help/aspnet/grid/grdusingcolumns.html
Thanks,
Jayesh Goyani
please check below link.
http://www.telerik.com/community/forums/aspnet/grid/change-radgrid-column-culture.aspx
http://www.telerik.com/community/forums/aspnet-ajax/grid/how-to-render-the-value-in-a-templated-radgrid-column-in-a-specific-culture-and-which-radgrid-event-to-do-this-in.aspx
http://www.telerik.com/help/aspnet/grid/grdusingcolumns.html
Thanks,
Jayesh Goyani
0

Mugdha Aditya
Top achievements
Rank 1
answered on 02 Aug 2011, 07:28 PM
Thanks for the reply jayesh :)
but 2nd link is not useful bcz m creating runtime columns n binding datable to grid. :(
in 1st link they have added culture for whole grid :(
but 2nd link is not useful bcz m creating runtime columns n binding datable to grid. :(
in 1st link they have added culture for whole grid :(
0
Accepted
Hi Mugdha,
You could try wiring the ItemDataBound event of RadGrid and use the same conversion method for the cell text as the one shown in the second link.
All the best,
Tsvetina
the Telerik team
You could try wiring the ItemDataBound event of RadGrid and use the same conversion method for the cell text as the one shown in the second link.
protected
void
RadGrid1_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridDataItem)
{
int
val = Convert.ToInt32((e.Item
as
GridDataItem)[
"ColUniqueName"
].Text);
(e.Item
as
GridDataItem)[
"ColUniqueName"
].Text = ConvertValue(val);
}
}
protected
string
ConvertValue(
object
val)
{
return
((
int
)val).ToString(
"C"
, CultureInfo.CreateSpecificCulture(
"en-US"
));
}
All the best,
Tsvetina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0

Mugdha Aditya
Top achievements
Rank 1
answered on 14 Sep 2011, 07:06 AM
Hey.... Thanuku so much...
it works perfect.
i want another help .. :)
You have added localization hardcoded , if i want to get machine localization then what to do?
i have done below , is that correct.. any idea ?
it works perfect.
i want another help .. :)
You have added localization hardcoded , if i want to get machine localization then what to do?
i have done below , is that correct.. any idea ?
protected
string
ConvertValue(
object
val)
{
return
((
int
)val).ToString(
"C"
, CultureInfo.CreateSpecificCulture(
System.Threading.Thread.CurrentThread.CurrentUICulture.Name
));
}
0

Mugdha Aditya
Top achievements
Rank 1
answered on 12 Oct 2011, 07:11 AM
Any updates :(
Actully am tring but i didnt not find any solution up till now.
it will be helpfull if you guys help me for this.
Actully am tring but i didnt not find any solution up till now.
it will be helpfull if you guys help me for this.
0
Hi Mugdha,
Your approach is correct, I tested it on my side too and it works fine. What problems do you encounter with using it?
Regards,
Tsvetina
the Telerik team
Your approach is correct, I tested it on my side too and it works fine. What problems do you encounter with using it?
Regards,
Tsvetina
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
0

Mugdha Aditya
Top achievements
Rank 1
answered on 24 Oct 2011, 02:28 PM
hi..
i have change my machine culture to spanish(argentina) i.e. es-AR in ("Regional and Language Options" control panel.)
i have tried below code to get machine localization but it always gives culture as en-US.
string strCulture = System.Globalization.CultureInfo.CurrentCulture;
i have change my machine culture to spanish(argentina) i.e. es-AR in ("Regional and Language Options" control panel.)
i have tried below code to get machine localization but it always gives culture as en-US.
string strCulture = System.Globalization.CultureInfo.CurrentCulture;
0
Hi Mugdha,
You can try the following:
Kind regards,
Tsvetina
the Telerik team
You can try the following:
protected
void
Page_PreRender(
object
sender, EventArgs e)
{
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Request.UserLanguages[0]);
string
strCulture = System.Threading.Thread.CurrentThread.CurrentCulture.Name;
Response.Write(strCulture);
}
Kind regards,
Tsvetina
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
0

Mugdha Aditya
Top achievements
Rank 1
answered on 04 Nov 2011, 07:59 AM
Thanks for your reply.. But its not working.
Request.UserLanguages[0] it return me en-US
Request.UserLanguages[1] returns me selected language (es-AR).
I have done below changes in my regonal settings. -> Regional options - >
Selected language as spanish (argentina)
then in adanced tab Selected language as spanish (argentina) and clicked on Apply all settings to the current user account and to the default user profile then apply and ok.
then restared my pc.
Am i missing somthing in settings??
Request.UserLanguages[0] it return me en-US
Request.UserLanguages[1] returns me selected language (es-AR).
I have done below changes in my regonal settings. -> Regional options - >
Selected language as spanish (argentina)
then in adanced tab Selected language as spanish (argentina) and clicked on Apply all settings to the current user account and to the default user profile then apply and ok.
then restared my pc.
Am i missing somthing in settings??
0
Hi Mugdha,
I am not sure what you are doing wrong but if your user's browser uses a certain culture, it should be detected through the user languages.
If you still have problems with this, try addressing common ASP.NET resources since the issue at hand is not directly related to our controls.
http://forums.asp.net/t/1708695.aspx/1
http://forums.asp.net/t/1551331.aspx/1
All the best,
Tsvetina
the Telerik team
I am not sure what you are doing wrong but if your user's browser uses a certain culture, it should be detected through the user languages.
If you still have problems with this, try addressing common ASP.NET resources since the issue at hand is not directly related to our controls.
http://forums.asp.net/t/1708695.aspx/1
http://forums.asp.net/t/1551331.aspx/1
All the best,
Tsvetina
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