Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

GridView headers: how to translate them

$
0
0

Hi there,

In my app I'm using Infralution assembly for translate each resource key in both RESX files. Everything is fine until I come to face up the translation for my GridViews headers...

and.. I got twice the name of each Header.

Resources file:

Public Shared ReadOnly Property RadGridViewCustomers_Nombre() As String

            Get
                Return ResourceManager.GetString("RadGridViewCustomers_Nombre", resourceCulture)
            End Get
End Property

XAML view:

Here you will see how I assign my SQL View (V_Clientes2) and then in Colummns collection I assign from my Resources file

the correct  key on Header property: Header="{Resx RadGridViewCustomers_Nombre}"

<Page ResxExtension.DefaultResxName="GIT_CuadroMando.MasterGIT" Language="{UICulture}"<telerik:RadGridView x:Name="dgvClientes" ItemsSource="{Binding V_Clientes2}" HorizontalAlignment="Left"
            Margin="10,44,0,-45" VerticalAlignment="Top" Height="531"
            Width="469" ColumnWidth="SizeToCells" PreviewMouseDoubleClick="dgvClientes_PreviewMouseDoubleClick" Grid.ColumnSpan="2" Grid.RowSpan="3"><telerik:RadGridView.Columns><telerik:GridViewDataColumn DataMemberBinding="{Binding Tipo}" Header="{Resx RadGridViewCustomers_Tipo}" /><telerik:GridViewDataColumn DataMemberBinding="{Binding Documento}" Header="{Resx RadGridViewCustomers_Doc}" /><telerik:GridViewDataColumn DataMemberBinding="{Binding Nombre}" Header="{Resx RadGridViewCustomers_Nombre}" />


Code-behind:

Imports Infralution.Localization.Wpf

..

   Dim ada As New SqlDataAdapter()
        Dim ds As New DataSet

        aBD.connection = New SqlConnection

        Dim cadenadeconnexio As String = ConfigurationManager.AppSettings("cadenaconexCASA8")
        aBD.connection.ConnectionString = cadenadeconnexio
        aBD.connection.Open()


        ada = New SqlDataAdapter("SELECT * FROM V_Clientes2", aBD.connection)
        ada.Fill(ds, "V_Clientes2")
        Me.dgvClientes.DataContext = ds



Results (totally inacceptable obviously):

I'm using one third-vendor GridView but think would happen the same using other control, it is very extrapolated to any control.

Thanks a lot for any hint or advice,


Primary platform is Windows 7 Ultimate 64 bit along with VS 2012/Sql2k8 for WPF/SilverLight projects.



Viewing all articles
Browse latest Browse all 18858

Trending Articles