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

[Solved] Strange behavior on selecting an item by clicking and selecting an item by typing

5 Answers 86 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Adam Plattner
Top achievements
Rank 1
Adam Plattner asked on 22 Dec 2009, 04:11 PM

http://demos.telerik.com/aspnet-ajax/combobox/examples/populatingwithdata/entitydatasource/defaultcs.aspx


I was playing the above demo app and found there is different behavior on selecting an item by clicking and selecting an item by typing

When select an item by clicking on it, the selected item will be highlighted and full list is remained. However if select the same item by typing it, the list is limited to the typed one.

My question is how to make the typing behavior is same as the clicking method? Is this default behavior? Is any future release will support this?

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 23 Dec 2009, 06:39 AM
Hi Adam,

The behavior of RadComboBox in demo is due to filtering the comboitems with typed text in input field in ItemRequested event. Remove that code and bind the RadComboBox normally and set the AllowCustomText property to True for showing all the items when typing in input field. Checkout the following demo:
ComboBox / Keyboard Support

-Shinu.
0
Adam Plattner
Top achievements
Rank 1
answered on 23 Dec 2009, 03:32 PM

Tested this solution and it doesn’t work for us. We have to it working with Load-On-Demand.

Is there any other way?

0
Yana
Telerik team
answered on 28 Dec 2009, 01:04 PM
Hi Adam,

You should not filter the items in ItemsRequested event handler, check the code in the example:

protected void RadComboBox1_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
    {
        EntityDataSource1.Where = "it.[ContactName] LIKE '" + e.Text + "%'";
        RadComboBox1.DataBind();
    }

please remove the Where clause in order to avoid limiting the items. Also I suggest you set MarkFirstMatch property to true to highlight the items while typing.

Greetings,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Adam Plattner
Top achievements
Rank 1
answered on 30 Dec 2009, 04:06 PM
Without the where clause, no matter what I typed, it always displays the first page.
I just don't see how this option will work on load demand.
0
Simon
Telerik team
answered on 04 Jan 2010, 12:04 PM
Hi Adam Plattner,

As a comment to your first post, the Load On Demand mechanism of RadComboBox is meant to work just in that way, i.e. when the user types a letter in the input, an incremental search is initiated and only Items matching a certain criteria are loaded and displayed.

In other words, what you are observing is the default, suggested behavior. Of course other logic can be implemented, still it will deviate very little from the main use-case.

Can you please describe in more details the behavior you are trying to implement?

Greetings,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ComboBox
Asked by
Adam Plattner
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Adam Plattner
Top achievements
Rank 1
Yana
Telerik team
Simon
Telerik team
Share this question
or