We have a binding setup from a TextBox to our business object, the binding DataSourceUpdateMode is set to OnPropertyChanged and the field we've bound to is a String type. Our object formats the string to be all UPPER case; if we type in an upper case character everything works as expected, however, if we type in a lower case character the cursor position in the TextBox goes back to 0.
Is this working properly or is this a bug; and do you have any recommended ways for getting around this
Thank you,
Phil

OnPropertyChanged databinding issue.
kizelli
Are there any good articles written yet on proper use of the binding sources It seems like there are many ways to accomplish the same thing. I digress...
Thanks again, I will look at my code in the morning and see if I'm missing something to get this to reproduce.
Phil
V4Venkat
Sweet, I hadn't seen that property :) Thank you for your quick response and kudos to you and your team for a fantastic product! Looks like our UI code will be reduced by about 80 - 90%.
PA
Are you using Beta 2 I can't reproduce this but I recall seeing something like this in earlier bits. If you are able to reproduce on Beta 2, can you attach some code that demonstrates the issue
Also - you can set the "CharacterCasing" property on the TextBox to force all upper/lower case entry.
Joe Stegman
The Windows Forms Team
Microsoft Corp.
This posting is provided "AS IS" with no warranties, and confers no rights.
lianaent
Our design is we assume the set will succeed or throw an exception. If it is successful (doesn't throw), we assume the value has not changed and therefore don't re-read it (this is by design for performance reasons). The second control is bound to the first data source, and picks up the value after it has been written to the data source (and turned into an upper case value). One way you can make this work is to hook the Validated event on the TextBoxes and add the following code:
private void nameTextBox_Validated(object sender, EventArgs e)
{
TextBox tb = (sender as TextBox);
if (null != tb)
{
Binding b = (sender as Control).DataBindings["Text"];
if (null != b)
{
b.ReadValue();
}
}
}
I have seen a similar request before from someone who was truncating their text value when writing it to a data source and wanted the Control to reflect the truncation. We could provide an option on the Binding type that forced a re-read. Please log a bug on this (http://lab.msdn.microsoft.com/productfeedback/default.aspx) and although we will probably not be able to address this in VS 2005, we will address this in our next release.
Joe Stegman
The Windows Forms Team
Microsoft Corp.
This posting is provided "AS IS" with no warranties, and confers no rights.