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

Rad ComboBox Filter text

5 Answers 126 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
HKJ
Top achievements
Rank 1
HKJ asked on 23 Sep 2015, 03:50 PM

Hello all,

I am using ComboBox with multi check box and Filter option. I would like to know how can I get text which i gave in input area (for filtering) in code behind.

 

For example, if i have a combobox which shows all the countries -> typed "Ge" input area. Then menu/option in the dropdown with filter accordingly.

Now my requirment is How will i get the string "Ge" in code behind (in any event) and i prefer to do this code behind rather JS.

 

I hope this makes sense and looking forward for its solution...

 

Thankz

5 Answers, 1 is accepted

Sort by
0
Accepted
Ivan Danchev
Telerik team
answered on 28 Sep 2015, 11:33 AM
Hello,

You can access the text typed by the user in the input field in the RadComboBox TextChanged server-side event as shown below:
protected void RadComboBox1_TextChanged(object sender, EventArgs e)
{
    string text = (sender as RadComboBox).Text;
}

More information about this event and the conditions under which it fires is available in the TextChanged documentation article.

Regards,
Ivan Danchev
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
HKJ
Top achievements
Rank 1
answered on 28 Sep 2015, 12:33 PM

Dear Admin,

 Thank you very much for your reply.

 

I tried this one and unfortunately its not working. It gives the text of the first item in the list rather the text/string which I typed.

For example, if Australia is the first item in the dropdown,  "(sender as RadComboBox).Text;" gives value 'Australia. I need to get the text i type in to filter the menu

 

Looking forward to hear from you soon.

 

 

Regards,

Hari

 

0
Accepted
Ivan Danchev
Telerik team
answered on 30 Sep 2015, 03:53 PM
Hello Hari,

The typed text will be available in TextChanged event handler if you click outside the ComboBox or hit Enter as explained in the linked article. You can see a short video that demonstrates getting the typed text. If you select an item from the returned result after entering the text, this Item's Text will be returned in the handler.

Regards,
Ivan Danchev
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
HKJ
Top achievements
Rank 1
answered on 30 Sep 2015, 04:32 PM

Dear Ivan,

 

Thank you very much for your support... It worked...

The missing part was """"  AllowCustomText ="true"  """"

 

Thank you once again 

 Regards,

Hari

0
Ivan Danchev
Telerik team
answered on 02 Oct 2015, 11:11 AM
Hello Hari,

I am glad it worked out at your end as well and you are now able to get the entered text. 

Regards,
Ivan Danchev
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
ComboBox
Asked by
HKJ
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
HKJ
Top achievements
Rank 1
Share this question
or