This is a migrated thread and some comments may be shown as answers.

Bool filter translation

6 Answers 320 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Oliver
Top achievements
Rank 1
Oliver asked on 08 Dec 2011, 08:56 PM
Hi,

I have a grid view with a checkbox column representing boolean values (true/false). When I'm trying to add a filter on this column, I see True and False as teh boolean text values. I want to know if it's possible to translate those values?

Thank's

6 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 12 Dec 2011, 08:40 AM
Hi Oliver,

Actually, the distinct values in the filter are based on the underlying property. As it this case, they are boolean values - true and false - the distinct values display - true and false. 
What you may try is to create a converter returning the translated strings, but still define your column as follows:

<telerik:GridViewDataColumnDataMemberBinding="{Binding IsChampion, Converter={StaticResource MyConverter}}">
                    <telerik:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <CheckBoxIsChecked="{Binding IsChampion,Mode=TwoWay}"/>
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellTemplate>
                </telerik:GridViewDataColumn>

I am sending you a sample project illustrating the suggested approach.
  Kind regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Oliver
Top achievements
Rank 1
answered on 12 Dec 2011, 10:46 PM
Hi,

is it possible to have the same theme (style ) than my application (OfficeBlue) with this solution?

Thank's
0
Maya
Telerik team
answered on 13 Dec 2011, 07:48 AM
Hello Oliver,

I am sending you the sample project updated with Office_Blue Theme being set. Furthermore, only after I had read your second post, I realized you are using RadGridView for WPF, not for Silverlight. So, this time the project targets WPF.  Please excuse me for the misunderstanding. Could you take a look at the sample project and let me know in case you need any further assistance ? 

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Adam
Top achievements
Rank 1
answered on 04 May 2012, 11:40 AM
Does it also work for a web application?
Or is there any other way to translate the content of a radgrid?
In my case I have string values which should be interpreted and shown in a rad grid depending of the selected language.
All this done in a RadGrid in a web application.
0
Maya
Telerik team
answered on 04 May 2012, 11:49 AM
Hello Adam,

Could you share a bit more details about your exact scenario ? Which version of RadGridView you are working with - Silverlight, ASP. NET ? Do you want to translate the elements of the grid itself or its items ? 

All the best,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Adam
Top achievements
Rank 1
answered on 04 May 2012, 12:04 PM
Hello Maya,

I use Telerik ASP.NET AJAX (Q2 2011).
My use case looks like that:
in a table I have a column with string values  like "A" (stands for Automatic) , "M" (stands for Manual) and "C" (stands for Closed).
Now I want to display this table but don't want to see the sting values (A, M, C) but the translated values like Automatic, Manuel, Closed (in english) or their equivalents in other languages, depending on selected language of course.
The user must be also able to filter by the translated value (not the value in the database).
Right now I use telerik:RadGrid and telerik:GridBoundColumn (in a MasterTableView) to display the values.

How can I convert and filter the A, M, C values into translated values? (For example display and filter on  "Automatic" instead of "A" in the database).

P.S.: I have already a translation table and method which gets the translations for headers and other strings in the page.
It works fine but I can't translate the values in the RadGrid column itself.

<telerik:RadGrid runat="server" ID="RadGrid" AllowSorting="True" Width="100%" Height="100%" AllowFilteringByColumn="true" EnableHeaderContextMenu="true"
        AutoGenerateColumns="false" OnItemCreated="RadGrid_ItemCreated">
<MasterTableView>
                <Columns>
                     <telerik:GridBoundColumn UniqueName="Assignability" DataField="Assignability" />
[..]
                </Columns>  
</MasterTableView>
</telerik:RadGrid>
Tags
GridView
Asked by
Oliver
Top achievements
Rank 1
Answers by
Maya
Telerik team
Oliver
Top achievements
Rank 1
Adam
Top achievements
Rank 1
Share this question
or