Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Edit a Integer value in the Grid

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
flc.net



Joined: 21 Jun 2005
Posts: 89
Location: Switzerland

PostPosted: Tue Mar 28, 2006 12:15 pm    Post subject: Edit a Integer value in the Grid Reply with quote

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
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Mar 28, 2006 10:05 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
flc.net



Joined: 21 Jun 2005
Posts: 89
Location: Switzerland

PostPosted: Wed Mar 29, 2006 6:53 am    Post subject: Reply with quote

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
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Mar 29, 2006 10:55 am    Post subject: Reply with quote

Yes you are correct - but in this case the value has changed (from an integer to a string!)
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
flc.net



Joined: 21 Jun 2005
Posts: 89
Location: Switzerland

PostPosted: Wed Mar 29, 2006 12:36 pm    Post subject: Reply with quote

ok.. i see.
but it's not possible to convert the type inside VT? Wink

Regards
Giuseppe
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group