I have a piece of code that refreshes a RadTextBox Text property depending on external events. In order not to change the Text property while the user is typing in the text box I check the Focused property first and proceed in overwriting the Text property only if it is false, the relevant code looks like this:
However in Telerik 2010Q1 this does not seem to work. I have tried to check at runtime and apparently the Focused property is always false even though I am editing that particular text-box. I have made a super-simplified test case and tried it with both Telerik 2009Q3 and 2010Q1 and it works correctly under version 2009Q3 (Focused is set to true when I'm typing in the field) but not on 2010Q1. Is this a bug or is there another way to check if a specific control has the input focus?
As a temporary workaround I noticed that the FocusedElement property is null when the text-box doesn't have the input focus and points to the embedded RadTextBoxItem when it has focus so I'm using it instead. However because FocusedElement is not documented I am a bit wary of using it.
private void event_ExternalUpdate(object sender, EventArgs args) |
{ |
if (!textBox.Focused) |
textBox.Text = "foo"; |
} |
However in Telerik 2010Q1 this does not seem to work. I have tried to check at runtime and apparently the Focused property is always false even though I am editing that particular text-box. I have made a super-simplified test case and tried it with both Telerik 2009Q3 and 2010Q1 and it works correctly under version 2009Q3 (Focused is set to true when I'm typing in the field) but not on 2010Q1. Is this a bug or is there another way to check if a specific control has the input focus?
As a temporary workaround I noticed that the FocusedElement property is null when the text-box doesn't have the input focus and points to the embedded RadTextBoxItem when it has focus so I'm using it instead. However because FocusedElement is not documented I am a bit wary of using it.