Culture problem while editing cells

3 posts, 1 answers
  1. Kristjan Einarsson
    Kristjan Einarsson avatar
    95 posts
    Member since:
    Jan 2010

    Posted 11 Oct 2010 Link to this post

    Hi, I'm having a problem when editing a double number in the TreeListView. The comma separator for our culture is ','. When editing a cell in the grid it changes to '.'. If the new number inserted contains ',' instead of '.' the number returned in the CellEditEnded event handler contains no comma even before I try to parse it to a double.
  2. Answer
    Nedyalko Nikolov
    Admin
    Nedyalko Nikolov avatar
    871 posts

    Posted 14 Oct 2010 Link to this post

    Hi Kristjan Einarsson,

    The best option for you is to set Language property of the RadGridView and everything should work fine:

    <telerik:RadGridView x:Name="radGridView" AutoGenerateColumns="True"                       Language="is">

    Language="is" stands for Icelandic language. If I'm not correct you can change it with your language.

    P.S. By the way RadGridView.CellEditEnded event comes too late in order to change something (edit process is already ended). You could use RadGridView.CellValidating event which exposes editing textbox via EditingElement property.

    Sincerely yours,
    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Kristjan Einarsson
    Kristjan Einarsson avatar
    95 posts
    Member since:
    Jan 2010

    Posted 16 Nov 2010 Link to this post

    Hello
    Sorry for the late reply. I've been busy with other parts of the project. We set the language in code - behind linking the CurrentCulture of the UI thread with language of the TreeListView. The data in the grid is now displayed in the correct manner.

    However there is still some strange behavior in the CellValidating and CellEditEnded handlers. If we enter a value with a comma i.e. 11,3 the e.NewData value is always without a comma i.e. 113. The strange thing is that the TreeListView is databound correctly, meaning if I use the databound variable instead of e.NewData everything works fine.

    We decided to use this workaround instead of spending more time on the issue.
Back to Top