Hey all,
I'm having an issue with the keyup event of textbox. I posted recently about
my datagrid messing up on the textchanged so I switched to keyup event and
for the most part that's solved the issue with the datagrid raising the
textchanged event (even though the text had not changed).
I'm navigating to the next row on keyup after a single keypress (assuming
valid input of course). The issue I'm seeing is that if you press a key
quickly a number of times sometimes the textbox.Text value is not updated.
If it was blank then it remains blank, even though the e.Key is the value of
the key pressed. I'm trying to figure out why this might be the case.
var tb = sender as TextBox;
if (tb != null)
{
tb.Text = tb.Text.ToUpper();
// if valid key then navigate to next row and begin edit.
}
I've put a check in to show me when its happening, as well as not navigate
to next field if key pressed doesn't match the textbox.Text (which SHOULD
never ever happen);
if (e.Key.ToString() == tb.Text)
{
// code above
}
else
{
Debug.WriteLine("Skipped a KeyUp :" + tb.Text);
}
and I can see it's still hitting this occasionally. On a screen of input
fields say 5 columns by 23 rows it does it two or three times (with fast key
entry). Typing slower seems to not be a problem.
Can anyone see what's going on here? multiple events? race condition? Maybe
the .ToUpper() causing issue somehow?
cheers,
Stephen
_______________________________________________
ozsilverlight mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight