View previous topic :: View next topic |
Author |
Message |
flc.net
Joined: 21 Jun 2005 Posts: 89 Location: Switzerland
|
Posted: Tue Mar 28, 2006 12:15 pm Post subject: Edit a Integer value in the Grid |
|
|
Hello Support
I have a Typed DataSet as a DataSource of VT. One DataColumn is an Integer. I have a TextBox as a CellEditor for this Column.
When I Click into the Integer Column (whitout make any changes) and then Change to another Row, the event SetCellValue is fired.
I noticed that the e.OldValue is an Integer and e.NewValue is a String.
I don't think in a prior Version it behaved like this (?)
Thanks and Best Regards
Giuseppe |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue Mar 28, 2006 10:05 pm Post subject: |
|
|
This behaviour is unchanged. The SetCellValue event is fired because the ValueChangedEvent for the editor is set to the "Validated" event for the control - which is firing as the text box loses focus. You could change this another event (eg TextChanged) to only be notified when the value changes.
If you want to use a text box editor for an integer cell then you will have to handle the conversion of the string to the integer yourself (along with the possibility that the user doesn't enter a valid integer). You should consider using a NumericUpDown or other control designed to restrict the user to entering numbers. _________________ Infralution Support |
|
Back to top |
|
|
flc.net
Joined: 21 Jun 2005 Posts: 89 Location: Switzerland
|
Posted: Wed Mar 29, 2006 6:53 am Post subject: |
|
|
Infralution wrote: | This behaviour is unchanged. The SetCellValue event is fired because the ValueChangedEvent for the editor is set to the "Validated" event for the control - which is firing as the text box loses focus. You could change this another event (eg TextChanged) to only be notified when the value changes.
.... |
I thought if when the value doesn't change, the SetCellValue is not fired. When I use a TextBox for a Cell that holds strings, the event is not fired.
Regards
Giuseppe |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Wed Mar 29, 2006 10:55 am Post subject: |
|
|
Yes you are correct - but in this case the value has changed (from an integer to a string!) _________________ Infralution Support |
|
Back to top |
|
|
flc.net
Joined: 21 Jun 2005 Posts: 89 Location: Switzerland
|
Posted: Wed Mar 29, 2006 12:36 pm Post subject: |
|
|
ok.. i see.
but it's not possible to convert the type inside VT?
Regards
Giuseppe |
|
Back to top |
|
|
|