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

[Solved] Automatic string to int conversion for editable cells

1 Answer 83 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.
Marc
Top achievements
Rank 1
Marc asked on 24 Aug 2011, 07:06 PM
sorry for asking another question...

when i set the DataType of a RadGridViewColumn to int or int? (because in my model the according property is of type object, not int --> needs to be generic) a TextBox is shown in edit mode. great! if i then enter e.g. 1234 my model receives this data as string, meaning "1234". i didn't attach a converter to the column, so i expected some kind of default logic to take place which delivers me 1234 as an int instead of a string. unfortunately i was wrong. is this the expected behaviour of RadGridViewColumn / Silverlight? if so, i have to write my own converters whenever i hit such a scenario, right?


thank you,
stephan

1 Answer, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 25 Aug 2011, 03:38 PM
Hi Stephan,

This is expected behavior.  The approach with an IValueConverter is the recommended one here.

All the best,
Pavel Pavlov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
GridView
Asked by
Marc
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Share this question
or