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

Auto-Complete Gone Wild

1 Answer 70 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Online .Net Developers
Top achievements
Rank 1
Online .Net Developers asked on 26 Feb 2009, 05:01 PM
This is an issue with a dropdown we have on a page that does a full Postback every time an entry is selected. 

1. Page loads and the text area of the RadComboBox is empty.
2. Type the first letter of several of the items.  The dropdown is filtered to just those items and the first one is displayed in the text area.
3. Hit return to select that item, and the page refreshes.
4. The full text of the selected item is displayed in the text area.
5. Click on the downward-pointing caret to bring up the drop-down menu.  The auto-complete is filtering out all entries except the current item.  In order to have the other entries selected, the text area must be manually cleared.

We have other dropdowns that don't do a Postback, and they always display the full list when you click to display the dropdown.  This is the desired behavior.

We are using the Q3 2008 version.

Thanks.

<telerik:RadComboBox ID="UsernameWebComboAGMembership" runat="server" Height="190px" EnableEmbeddedSkins="false" Skin="IMCComboStyle"  
    Width="320px" DropDownWidth="480px" MarkFirstMatch="true" OnDataBound="UsernameWebComboAGMembership_DataBound" EnableLoadOnDemand="true" HighlightTemplatedItems="true" 
    ItemRequestTimeout="500" OnClientItemsRequested="UpdateItemCountField" AutoPostBack="true" 
     
    OnItemsRequested="UsernameWebComboAGMembership_ItemsRequested" OnItemDataBound="UsernameWebComboAGMembership_ItemDataBound" 
    OnSelectedIndexChanged="UsernameWebComboAGMembership_SelectedIndexChanged" > 
    <HeaderTemplate> 
        <ul> 
            <li class="rcbColumn1">User Name</li> 
            <li class="rcbColumn2">First Name</li> 
            <li class="rcbColumn3">Surname</li> 
        </ul> 
    </HeaderTemplate> 
    <ItemTemplate> 
        <ul> 
            <li class="rcbColumn1"><%# DataBinder.Eval(Container.DataItem, "UserName") %></li
            <li class="rcbColumn2"><%# DataBinder.Eval(Container.DataItem, "FirstName") %></li
            <li class="rcbColumn3"><%# DataBinder.Eval(Container.DataItem, "LastName") %></li
        </ul> 
    </ItemTemplate> 
    <FooterTemplate> 
         <asp:Label runat="server" ID="RadComboItemsCount" /> users 
    </FooterTemplate> 
</telerik:RadComboBox> 
 


1 Answer, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 03 Mar 2009, 04:57 PM
Hi Online .Net Developers,

This is the default behavior of the control in the described cases.

In the first case, since the RadComboBox is empty after the PostBack, Items are requested with the text in the input, which is actually the selected Item.

In the second case, the Items are not requested again, simply the previously loaded list is shown again.

You could workaround this behavior in the first case by subscribing to the OnClientItemsRequesting event of the RadComboBox in question and set a variable in the Context which would be an empty string in case the RadComboBox does not have any Items loaded in it; otherwise it should be the text in the input.

Kind regards,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
ComboBox
Asked by
Online .Net Developers
Top achievements
Rank 1
Answers by
Simon
Telerik team
Share this question
or