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

Culture problem while editing cells

2 Answers 69 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Kristjan Einarsson
Top achievements
Rank 1
Kristjan Einarsson asked on 11 Oct 2010, 11:49 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Nedyalko Nikolov
Telerik team
answered on 14 Oct 2010, 09:20 AM
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
0
Kristjan Einarsson
Top achievements
Rank 1
answered on 16 Nov 2010, 10:10 AM
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.
Tags
TreeListView
Asked by
Kristjan Einarsson
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Kristjan Einarsson
Top achievements
Rank 1
Share this question
or