Print Page | Close Window

Grid Editing Control doesn't always update the Binding Source

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=547
Printed Date: 04-Apr-2025 at 9:26pm


Topic: Grid Editing Control doesn't always update the Binding Source
Posted By: Miszou
Subject: Grid Editing Control doesn't always update the Binding Source
Date Posted: 14-Nov-2007 at 1:59pm
I have a custom editing control (Nullable Date Picker) for use in a grid, and no matter what I try, I cannot get it to work properly. I am almost there, but there is one last thing that just won't work!
 
If I edit (TextBox) the value in the control, and then click another cell in the grid, the value is accepted and the binding source is updated.
 
However, if I press the Tab key to move to the next cell, the value is discarded and replaced with the previous value. All the relevant events fire (TextBox.Validating, TextBox.Validated etc), but the value is not updated in Binding Source.
 
Upon further investigation, it appears that the CurrentItemChanged event of the BindingSource is only fired if I change focus with the mouse.
 
I know that I'm close to getting this to work, but I just can't figure out why it would work when changing cell focus from a mouse event and not a keyboard event!
 
Any help would be greatly appreciated!



Replies:
Posted By: davidklitzke
Date Posted: 14-Nov-2007 at 3:12pm
Do you have a DataBinder for  your CustomNullableDatePicker working as  a Loose Control and another DataBinder for your CustomNullableDatePicker when it is working inside of a Grid?



Print Page | Close Window