Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsLanguage PacksLanguage PacksGridView HeaderText localizationGridView HeaderText localization
Previous
 
Next
New Post
9/6/2006 7:25 PM
 

This is a piece of code I used in one of my modules to localize a GridView:

                   // Localized grids
                    foreach (DataControlField c in gridview1.Columns)
                    {
                        c.HeaderText = Localization.GetString(c.HeaderText + ".Header", LocalResourceFile);
                    }


Vicenç Masanas
Banyoles, Girona - Spain

Disgrafic.com    PSD to DNN
 
New Post
9/19/2006 9:06 AM
 
    Many thanks

I can see that this code will work.  But I have to trigger it from a nested gridview.  Which gridview event should I attach it to, and quite how?

Regards

Geoffrey



Geoffrey Morton-Haworth www.yalaworld.net
 
New Post
9/24/2006 11:31 AM
 

Having an issue with this as well.  Using this code on GridView.load

 

Dim c As DataControlField

For Each c In GridView1.Columns

c.HeaderText = Localization.GetString("lbl" & c.HeaderText & ".Text", Me.LocalResourceFile)

Next

If I place the localization strings in the App_GlobalResources->SharedResources.resx file, it works fine.  But not if the localization strings are in the ascx file's .resx file.  What am I missing?

 
New Post
9/24/2006 12:04 PM
 

EDIT to last post

I'm using DNN 4.3.5, and it appears the changes to localization is the issue.  Where this code worked fine before;

Dim c As DataControlField

For Each c In GridView1.Columns

c.HeaderText = Localization.GetString("lbl" & c.HeaderText & ".Text", Me.LocalResourceFile)

Next

It now appears that the LocalResourceFile function only returns the directory and not the file name, so this code works:

Dim c As DataControlField

For Each c In GridView1.Columns

c.HeaderText = Localization.GetString("lbl" & c.HeaderText & ".Text", Me.LocalResourceFile & "\THEFILENAME.ascx.resx")

Next

 

Can anyone confirm this?  Is this intentional?  This seeems like a breaking change if so.

 
New Post
12/7/2006 5:36 AM
 
BJSammons wrote

EDIT to last post

I'm using DNN 4.3.5, and it appears the changes to localization is the issue.  Where this code worked fine before;

Dim c As DataControlField

For Each c In GridView1.Columns

c.HeaderText = Localization.GetString("lbl" & c.HeaderText & ".Text", Me.LocalResourceFile)

Next

It now appears that the LocalResourceFile function only returns the directory and not the file name, so this code works:

Dim c As DataControlField

For Each c In GridView1.Columns

c.HeaderText = Localization.GetString("lbl" & c.HeaderText & ".Text", Me.LocalResourceFile & "\THEFILENAME.ascx.resx")

Next

 

Can anyone confirm this?  Is this intentional?  This seeems like a breaking change if so.

Yes, I can confirm this.

In my case, Me.LocalResourceFile will return "XXX\THEFILENAME", not "XXX\THEFILENAME.ascx.resx". So I have to create the resource file Url manually instead of relying on Me.LocalResourceFile. Thanks a lot for bringing this up

Frank

 

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsLanguage PacksLanguage PacksGridView HeaderText localizationGridView HeaderText localization


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out