Yes, there is no param for culture in GridHtml.
The culture will automatically pick from the Current Thread / Node culture.
But we can switch the culture using the following code
var lang="da" //culture iso code you can change here
var data = UmbracoContext.VariationContextAccessor.VariationContext = new VariationContext(lang);
Thread.CurrentThread.CurrentCulture = new CultureInfo(lang);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(lang);
This will change the current culture and then you just call the GridHtml method, then the data will show against the culture you set :).
Grid Html varying by culture???
Hey all.
Getting model content by culture seems pretty straightforward:
But how do I get GridHtml by culture??? There doesn't seem to be a parameter for this in the Html.GetGridHtml method?
Any suggestions?
Hi Garrien,
Yes, there is no param for culture in
GridHtml
. The culture will automatically pick from the Current Thread / Node culture.But we can switch the culture using the following code
This will change the current culture and then you just call the GridHtml method, then the data will show against the culture you set :).
Regards Dhanesh :)
Thank you. It works with your advise!
Kind regards. Kris.
is working on a reply...