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

Dropdown not expanding on text change

1 Answer 65 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Andy Byrne
Top achievements
Rank 1
Andy Byrne asked on 14 Jan 2011, 06:52 PM
Hello,

I have a simple drop down:

<div style="margin: 0 0 15px 0;"><b>Available User(s):</b>
<telerik:RadComboBox ID="rcbApprovalUsers" runat="server" MarkFirstMatch="true" AllowCustomText="false"
    Filter="Contains" Width="250px" />
</div>

void rcbApprovalUsers_DataBinding(object sender, EventArgs e)
{
    List<ApproverInfo> unassignedApprovalUsers =
        CustomerFactory.ApprovalForwardingGetUnassigned(ECISite.ID, Master.ECICustomer.ID, Master.ECISession.AccountInfo.AccountNumber);
 
    rcbApprovalUsers.Visible = bAddApprover.Visible = (unassignedApprovalUsers.Count != 0);
    lNoApproversAvailable.Visible = (unassignedApprovalUsers.Count == 0);
 
 
    if (unassignedApprovalUsers.Count > 0)
    {
        rcbApprovalUsers.DataSource = unassignedApprovalUsers;
        rcbApprovalUsers.DataTextField = "UserInfo";
        rcbApprovalUsers.DataValueField = "CustomerID";
        rcbApprovalUsers.SelectedValue = unassignedApprovalUsers[0].CustomerID.ToString();
    }
}

If I click on this drop-down I see the following behaviors:

1) Text for selected value is highlighted.
2) Combo box expands to display values
3) On typing values the values filter to those containing the typed text

However, if I tab to this drop-down the behavior is different.  The combo box won't expand when I start typing and the only way to make this happen is to physically click on the combo box.

Is there a way to make the combo box expand when they start typing regardless of whether they tabbed or clicked to it?  Basically I would like the user to be able to see the available values containing their typed text without having to click the drop-down.

Thanks,
Andy

1 Answer, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 18 Jan 2011, 01:15 PM
Hello Andy Byrne,

You could add the following event to your code:
<script type="text/javascript">
        function onKeyPressing(sender, eventArgs) {
            if (!sender.get_dropDownVisible())
                sender.showDropDown();
        }
    </script>

and then hook it here:
<telerik:RadComboBox ID="rcbApprovalUsers" runat="server" MarkFirstMatch="true" AllowCustomText="false" OnClientKeyPressing="onKeyPressing" Filter="Contains" Width="250px">

All the best,
Katerina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
ComboBox
Asked by
Andy Byrne
Top achievements
Rank 1
Answers by
Kate
Telerik team
Share this question
or