BindingSource.UpdateTarget() Method giving problems

Grids for WPF Forum

Posted 12 years ago by Pankaj Sood
Version: 11.2.0553
Avatar

Hi Members,

I am using BindingSource.UpdateTarget() method on property gird's KeyBoardLostfocus Event to Undo the textbox Values and its working fine. But properties on which we have implmented any validation (e.g. numeric input validation) this method fails. This method unable to undo the the value of those properties on ESC key press.

private void PropertyGrid_LostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
KeyboardDevice keyboardDevice = e.KeyboardDevice as KeyboardDevice;
if (keyboardDevice != null)
{
if (keyboardDevice.IsKeyDown(Key.Escape))
{
TextBox textBox = e.OriginalSource as TextBox;
if (textBox != null)
{
BindingExpression bindingExpression = (textBox).GetBindingExpression(TextBox.TextProperty);

if (bindingExpression != null)
{
bindingExpression.UpdateTarget();
}
}
}
}
}

Any one any suggestions ?

Regards

Pankaj

Comments (1)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Pankaj,

If you can please put together a small sample project that reproduces your issue and email it over then we can take a closer look. Be sure to remove any executables or change the extension of the zip file to ensure it gets past our email filters.


Actipro Software Support

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.