Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

PortalWebHosting
  Ads  
Engage Software - Training Partner for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
The Official Microsoft ASP.NET Website
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Localize It! (L...  How to use resource file for gridview
Previous Previous
 
Next Next
New Post 6/2/2008 11:24 AM
User is offline sindhu
3 posts
10th Ranked


How to use resource file for gridview  

I have a custom developed module .Now i want to use a resource file for my user control .The user control has a gridview ,formview and few other label controls .How to localise them ?Any ideas ? Please help me out .Thanks

 
New Post 6/2/2008 11:33 AM
User is offline Mitch Sellers
5692 posts
www.mitchelsellers.com
3rd Ranked




Re: How to use resource file for gridview  

You will want to look at the Localization Guide that is available from the documentation section of this site.


-Mitchel Sellers
MCITP, MCPD, MCTS
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Consulting Quotes, and DNN Technical Support Services

I reccomend 3Essentials for shared hosting and BaseCamp for project management
 
New Post 6/2/2008 11:40 AM
User is offline Yehuda Tiram,
128 posts
9th Ranked


Re: How to use resource file for gridview  

Call in pageload:

LocalizeGridView(GridView1, LocalResourceFile)

and put this somewhere:

 

        Public Shared Sub LocalizeGridView(ByVal gv As GridView, ByVal ResourceFile As String)
            Dim key As String
            Dim localizedText As String
            Dim pi As System.Reflection.PropertyInfo

            For Each col As DataControlField In gv.Columns
                key = col.HeaderText
                If key <> "" Then
                    localizedText = Localization.GetString(key & ".Header", ResourceFile)
                    If localizedText <> "" Then
                        col.HeaderText = localizedText
                    End If
                End If

                'Localize text of Cancel, Delete, Edit, Insert, Select, New, Update buttons
                If TypeOf col Is CommandField Then
                    Dim cmdField As CommandField = DirectCast(col, CommandField)
                    For Each cmdName As String In New String() {"Cancel", "Delete", "Edit", "Insert", "Select", "New", "Update"}
                        pi = cmdField.GetType.GetProperty(cmdName & "Text", GetType(String))
                        key = CType(pi.GetValue(cmdField, Nothing), String)
                        If Not String.IsNullOrEmpty(key) Then
                            localizedText = Localization.GetString(key & ".CommandText", ResourceFile)
                            If localizedText <> "" Then
                                pi.SetValue(cmdField, localizedText, Nothing)
                            End If
                        End If
                    Next
                End If
            Next
        End Sub

 
New Post 6/2/2008 7:23 PM
User is offline William Severance
821 posts
www.wesnetdesigns.com
7th Ranked






Re: How to use resource file for gridview  

At the time I wrote the code provided by Yehuda Tiram, the core did not provide a means to localize the GridView control. However, this capability (plus the localization of DetailsView controls) was added to DNN version 4.6.0 and above:

In the class DotNetNuke.Services.Localization.Localization:

Public Shared Sub LocalizeGridView(ByRef gridView As GridView, ByVal resourceFile As String)

Public Shared Sub LocalizeDetailsView(ByRef detailsView As DetailsView, ByVal resourceFile As String)

Bill, WESNet Designs
 
New Post 6/2/2008 10:41 PM
User is offline Yehuda Tiram,
128 posts
9th Ranked


Re: How to use resource file for gridview  

Hi Bill,

Sorry for not giving you the credit. I just found the code somewhere a long time ago and kept it.

Yehuda

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Localize It! (L...  How to use resource file for gridview
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


TMA Resources
TMA Resources is a software company providing eBusiness solutions for the Association market.
www.tmaresources.com
DotNetNuke Hosting Provider UK
UK leading DotNetNuke Hosting provider. Owned and operated by a Microsoft Gold Certified Partner.
www.DNN-Portals.co.uk
Alliance Systems & Programming Inc
Alliance is not just our name... it's how we do business. We partner with our clients, learning their business processes and standards and then applying our expertise to help them improve their workflow and profitability.
www.Alliancesys.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP