Products

Solutions

Resources

Partners

Community

About

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
7/4/2006 6:16 AM
 
Hi Guys,
 
I have got a problem with gridview header text localization.
There is a method available localizeDataGrid that of course does not accept GridView as required parameter, so is there any way to localize header text for GridView?
 
Any help appreciated.
 
Thanks.
 
New Post
7/4/2006 8:06 AM
 

Have a look on the source of the LocalizeDataGrid function, you will see that it is straight forword, and you can take the code and make a modified version of it in your module to localize the GridView, I did the same with a 3rd party tab strip control, I made a function called LocalizeTabStrip and modified the code from the LocalizeDataGrid to fit the control I have.

 


Bilal Al-Ghazi
 
New Post
9/4/2006 11:46 AM
 
    Hi

I have the same question but I am having trouble tracking down the LocalizeDataGrid code - where can I find it?

Thanks

Geoffrey

Geoffrey Morton-Haworth www.yalaworld.net
 
New Post
9/4/2006 1:49 PM
 

you can find localizeDatagrid in the Localization class, in the file localization.vb. If you are interested in the source, you need to download the source version of dnn (not the starterkit version), the file is located in the library, which sits outside the website under dnn 4 (the starterkit only contains the compiled library dll's)

cheers,

Erik


Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
New Post
9/5/2006 6:14 AM
 

Hi there

Thanks for the tip.  I have now found the LocalizeDataGrid code, and I have modified it as follows…

Public Shared Sub LocalizeGridView(ByRef grid As GridView, ByVal ResourceFile As String)

            Dim col As DataGridColumn

            Dim key As String

            Dim localizedText As String

            For Each col In grid.Columns

                'Localize Header Text

                key = col.HeaderText

                If key <> "" Then

                    localizedText = Services.Localization.Localization.GetString(key & ".Header", ResourceFile)

                    If localizedText <> "" Then

                        col.HeaderText = localizedText

                    End If

                End If

            Next

        End Sub

I am not confident about this because I could find no Grid View equivalent to DataGridColumn.  But I cannot taest it because I cannot find where to put the LocalizeGridView(dgIssueViewList, Me.LocalResourceFile) code that calls it.

You see my GridView is nested in a DataList and is initiated by this sort of code

<asp:GridView

id="dgIssueViewList"

width=525

BorderWidth=0

CellPadding=0

CellSpacing=4

AutoGenerateColumns=false

runat=server

DataSource='<%# GetViews(Eval("ItemID")) %>' Visible=true

EnableViewState=false

HeaderStyle-HorizontalAlign="Justify">

                     <Columns >

                           <asp:TemplateField

Headertext="View"

headerstyle-cssclass="NormalBold"

ItemStyle-VerticalAlign="Top" HeaderStyle-HorizontalAlign="Left">

                            <itemtemplate>  

 

Etc…

                                   

                                </ItemTemplate>

                           </asp:TemplateField>

                        </Columns>

                    </asp:GridView>

 

Putting LocalizeGridView in the GetViews function does not work.  I need something for the GridView like the DataGrid’s OnItemDataBound event.

Of course I could build the whole thing up with placeholders and user controls and localize it that way but I don’t know what it would do for speed.

Any suggestions?

Kind regards

Geoffrey


Geoffrey Morton-Haworth www.yalaworld.net
 
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