This is a migrated thread and some comments may be shown as answers.

How to get the typed text?

1 Answer 78 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Alfa
Top achievements
Rank 1
Alfa asked on 10 Mar 2010, 07:57 AM
Hi,

In my application, i have requirement where
when user types in text in combobox and moves out(lost of focus), if the text is not in ItemList, this text must be added in ItemList.

I have used 
void Control_LostFocus(object sender, RoutedEventArgs e)
{
if (!Duplicate(this.Text))
{
Control.Items.Insert(0, (new RadComboBoxItem() { Content = This.Text}));
}
}

It works fine in most of the situation but in the case where, say "AAA" is already in ItemList, I type "A" and move out...
'A' doesn't get inserted because, this.Text returns "AAA" not "A".

So, my question is can i get the typed text from ComboBox.?

I tried 
TextBox textBox = this.ChildrenOfType<TextBox>()[0];
string text = textBox.SelectedText; //textBox.Text //non of them gave Typed text.

But strangely when I use this code, the ComboBox stops opening\displaying items.

Rdgs
Afla 

1 Answer, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 10 Mar 2010, 10:12 AM
Hi Alfa,

Please, download the latest internal build of RadControls for Silverlight, where the behavior of the Text property should be much more consistent, e.g. the property will always contain the string that is visible in the TextBox:
http://www.telerik.com/account/downloads/internal-builds.aspx

Regards,
Valeri Hristov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
ComboBox
Asked by
Alfa
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Share this question
or