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

Boolean Column When grouping show true false, how to local words?

4 Answers 249 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Onur Mustafa
Top achievements
Rank 1
Onur Mustafa asked on 28 Dec 2011, 11:11 AM
How we can change "boolean column grouping value" true false to our language. I want to use checkbox in my column, i do not want to change it.


            if (propertyDescriptor.PropertyType == typeof(bool))
            {
                column.DataMemberBinding = new Binding(header.Key);
                ??????
            }

4 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 28 Dec 2011, 12:13 PM
Hello Onur,

You can try creating a converter and use it in the binding of the corresponding GroupHeaderTemplate. It could be something like follows:

<telerik:GridViewDataColumn DataMemberBinding="{Binding Name}">
                    <telerik:GridViewDataColumn.GroupHeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Group.Key, Converter={StaticResource MyConverter}}" />
                        </DataTemplate>
                    </telerik:GridViewDataColumn.GroupHeaderTemplate>
                </telerik:GridViewDataColumn>

I hope it helps.

Regards,
Maya
the Telerik team

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

0
Onur Mustafa
Top achievements
Rank 1
answered on 28 Dec 2011, 01:08 PM
Thanks for quick reply but we made a class and we wants to make all our list behave like that. How can we do this in our class ?

public class Lister : RadGridView
{

}
0
Onur Mustafa
Top achievements
Rank 1
answered on 28 Dec 2011, 01:15 PM
And I can not see GroupHeaderTemplate, there is only GroupFooterTemplate in GridViewDataColumn class?
0
Maya
Telerik team
answered on 28 Dec 2011, 02:34 PM
Hello,

Generally, both RadGridView and GridViewBoundColumnBase (GridViewDataColumn respectively) have GroupHeaderTemplate:

<telerik:RadGridView  Name="clubsGrid" >
            <telerik:RadGridView.GroupHeaderTemplate>
                <DataTemplate>
                    ....
                </DataTemplate>
            </telerik:RadGridView.GroupHeaderTemplate>
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}">
                    <telerik:GridViewDataColumn.GroupHeaderTemplate>
                        <DataTemplate>
                            .....
                        </DataTemplate>
                    </telerik:GridViewDataColumn.GroupHeaderTemplate>
                </telerik:GridViewDataColumn>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>


You can implement the same idea in your application as well. If it is appropriate for your scenario, you can define a DataTemplate in the Resources section and assign it to your grid for example.
However, the most appropriate implementation depends entirely on your exact settings and requirements.
 

Regards,
Maya
the Telerik team

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

Tags
GridView
Asked by
Onur Mustafa
Top achievements
Rank 1
Answers by
Maya
Telerik team
Onur Mustafa
Top achievements
Rank 1
Share this question
or