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

[Solved] gridview edit decimal value different from display value

7 Answers 279 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jonam
Top achievements
Rank 1
Jonam asked on 21 Oct 2010, 11:01 PM
hello,

i have a gridview that displays a decimal. In the display mode it show the decimal like 1,01 (using a comma)

when i switch to edit suddenly it uses 1.01 (using a dot). Is there a way to influence this behaviour?

kind regards,

Jonam

7 Answers, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 22 Oct 2010, 02:18 PM
Hi Jonam,

This issue has been fixed and fix is available with our latest internal build (LIB).
Could you please try your scenario with our LIB (uploaded today) and let me know how it works?

Regards,
Nedyalko Nikolov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Joachim
Top achievements
Rank 1
answered on 22 Oct 2010, 04:36 PM
Hello,

I have the same problem as Jonam.
I'm using the last internal build (RadControls_for_Silverlight_4_2010_2_1022_DEV) and the issue is still here :/
I have attached screenshot of the issue...
0
Nedyalko Nikolov
Telerik team
answered on 26 Oct 2010, 08:46 AM
Hello JOACHIM,

I've just checked and everything seems to work as expected. Perhaps there is another different issue.
Could you please provide me with some more information about your scenario? I need RadGridView and column which causes the problem settings.
Thank you in advance.

Greetings,
Nedyalko Nikolov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Joachim
Top achievements
Rank 1
answered on 26 Oct 2010, 11:12 AM
I have made a simple example to show you the issue.
There is the code of a simple UserControl with a  simple RadGridView which it's ItemsSource is bind to a simple Collection.

<UserControl x:Class="CommaIssueTelerik.MainPage"
    xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
    xmlns:local="clr-namespace:CommaIssueTelerik"
    mc:Ignorable="d"
              
    d:DesignHeight="300" d:DesignWidth="400">
     
    <UserControl.Resources>
        <local:RadGridViewItemSource x:Key="RadGridViewItemSource" />
    </UserControl.Resources>
 
    <Grid x:Name="LayoutRoot" Background="White">
        <telerikGridView:RadGridView ItemsSource="{Binding Path=Collection, Source={StaticResource RadGridViewItemSource}}" >
        </telerikGridView:RadGridView>
    </Grid>
</UserControl>

There is my very simple Collection of decimal :
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Collections.Generic;
 
namespace CommaIssueTelerik
{
    public class RadGridViewModel
    {
        public decimal MyDecimal1 { get; set; }
        public decimal MyDecimal2 { get; set; }
        public decimal MyDecimal3 { get; set; }
        public decimal MyDecimal4 { get; set; }
    }
 
    public class RadGridViewItemSource : INotifyPropertyChanged
    {
 
        public event PropertyChangedEventHandler PropertyChanged;
 
        private ObservableCollection<RadGridViewModel> _collection;
        public ObservableCollection<RadGridViewModel> Collection
        {
            get { return _collection; }
            set
            {
                if (_collection != value)
                {
                    _collection = value;
                    OnPropertyChanged("Collection");
                }
            }
        }
 
        protected void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
 
        public RadGridViewItemSource()
        {
            List<RadGridViewModel> list = new List<RadGridViewModel>();
            for (decimal i = 0; i < 10; i = i + (decimal)0.1)
            {
                RadGridViewModel item = new RadGridViewModel()
                {
                    MyDecimal1 = i,
                    MyDecimal2 = i + 1,
                    MyDecimal3 = i + 2,
                    MyDecimal4 = i + 3,
                };
                list.Add(item);
            }
 
            Collection = new ObservableCollection<RadGridViewModel>(list);
        }
    }
 
    
}

And i have attached screenshots with the issue and the Telerik's version. It's very very very easy to reproduce this issue.
Jonam do you still have this problem with the last internal build ? What do i do wrong ?

Thank you for your help, i don't understand where i do an error...
0
Joachim
Top achievements
Rank 1
answered on 28 Oct 2010, 08:36 AM
Please, tell me if you need more information.

But if you copy/paste my code above in a simple project you can easily reproduce the issue with your last internal build (Silverlight_4_2010_2_1022_DEV)
0
Nedyalko Nikolov
Telerik team
answered on 28 Oct 2010, 12:53 PM
Hi JOACHIM,

The problem comes from the culture which you are using (I guess that it is fr-FR) and FrameworkElement.Language property which is used in binding converters. By default this property is ("en-US") no matter that different culture is in use. We will fix this issue with the next latest internal build, as a workaround you can set RadGridView.Language property:

<telerik:RadGridView x:Name="radGridView" Language="fr-FR" />

P.S. I've updated your Telerik points accordingly.

All the best,
Nedyalko Nikolov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Joachim
Top achievements
Rank 1
answered on 28 Oct 2010, 01:19 PM
Thank you Nikolov,

You guessed it my culture is fr-FR.
Your workaround works ! So i'm not stuck with that problem anymore.

Good job,

Joachim.

PS : Can you mark your post as answered ? I can't
Tags
GridView
Asked by
Jonam
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Joachim
Top achievements
Rank 1
Share this question
or