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

Formatting numeric values in a GridViewDataColumn with a custom group separator

5 Answers 267 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Pascal GUERY
Top achievements
Rank 1
Pascal GUERY asked on 03 Mar 2014, 04:41 PM
Hi everyone,

I have developed a sample WPF projet referencing RadControls for WPF Q3 2013 Trial Version assemblies.
The main window contains a RadGridView.
The RadGridView has only one column which is a GridViewDataColumn.
I have written code in the main window's constructor to fill the RadGridView's Items collection with anonymous objects.
The anonymous objects have only one property named Value and whose type is double.
The GridViewDataColumn is bound to the Value property.

Here is the main window's XAML markup :

<Window x:Class="GridViewColumnFormat.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <telerik:RadGridView x:Name="m_grid" AutoGenerateColumns="False">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataFormatString="F2" DataMemberBinding="{Binding Path=Value}" />
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>
</Window>

Here is the main window's code-behind :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
 
namespace GridViewColumnFormat
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
 
            for (double l_index = 1000; l_index <= 20000; l_index += 1000.99)
            {
                m_grid.Items.Add(new { Value = l_index });
            }
        }
    }
}

The attached picture shows the main window.

I have set the GridViewDataColumn's DataFormatString property.
I want the space character to be the group separator for displaying values.
How can I set a custom group separator ?

Thank your in advance for your help

5 Answers, 1 is accepted

Sort by
0
Pascal GUERY
Top achievements
Rank 1
answered on 05 Mar 2014, 04:00 PM
I have submitted a support ticket describing the same need by using a Telerik account with a valid support license.
The support ticket's ID is 794929.
You are not forced to reply to this thread.
I wanted to delete this thread but I do not know how to do it.
0
Hristo
Telerik team
answered on 06 Mar 2014, 09:33 AM
Hello Pascal,

You can achieve the desired behavior by modifying the current culture. In order to apply this culture to the RadGridView you will have to set the property IsLocalizationLanguageRespected to false. More information on this property can be found here.

Please check the attached project for more details.

Regards,
Hristo
Telerik

DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!

0
Hristo
Telerik team
answered on 12 Mar 2014, 12:40 PM
Hello Pascal,

You can achieve the desired behavior by modifying the current culture. In order to apply this culture to the RadGridView you will have to set the property IsLocalizationLanguageRespected to false. More information on this property can be found here.

Please check the attached project for more details.


Regards,
Hristo
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
0
Hristo
Telerik team
answered on 18 Mar 2014, 09:31 AM
Hello Pascal,

You can achieve the desired behavior by modifying the current culture. In order to apply this culture to the RadGridView you will have to set the property IsLocalizationLanguageRespected to false. More information on this property can be found here.

Please check the attached project for more details.

 
Regards,
Hristo
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
0
Administrator
Telerik team
answered on 19 Mar 2014, 10:08 AM
Hello Pascal,

You can achieve the desired behavior by modifying the current culture. In order to apply this culture to theRadGridView you will have to set the property IsLocalizationLanguageRespected to false. More information on this property can be found here

Please check the attached project for more details.

Regards,
Administrator
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
Tags
GridView
Asked by
Pascal GUERY
Top achievements
Rank 1
Answers by
Pascal GUERY
Top achievements
Rank 1
Hristo
Telerik team
Administrator
Telerik team
Share this question
or