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

"SelectOnTab" problem

1 Answer 65 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 03 Jul 2008, 04:27 PM
I noted in another thread that the"SelectOnTab" functionality is enabled by default in the new control.  This is not working for me for load on demand.  The user can enter text but tabbing out of the control does not force a selection.

Control:
<telerik:RadComboBox ID="userRadComboBox" runat="server" EnableLoadOnDemand="True" 
ShowMoreResultsBox="True" Skin="Outlook" OnItemsRequested="userRadComboBox_ItemsRequested" 
Width="250px"
<CollapseAnimation Duration="200" Type="OutQuint" /> 
</telerik:RadComboBox> 
>
LoadOnDemand handler:
    protected void userRadComboBox_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e) 
    { 
        RadComboBox userRadComboBox = o as RadComboBox; 
        userRadComboBox.Items.Clear(); 
 
        string text = e.Text; 
 
        try 
        { 
            // Bind User names 
 
            RPFirehouseUserCollection coll = new RPFirehouseUserCollection(); 
 
            coll.Query.FhuStaffId.Trim(); 
            coll.Query.Where(coll.Query.FhuStaffId != String.Empty); 
 
            coll.Query.Where(coll.Query.FhuStaffId.Like(text + "%")); 
            coll.Query.OrderBy(coll.Query.FhuStaffId.Ascending); 
 
            if (coll.Query.Load()) 
            { 
                int itemsPerRequest = 20; 
                int itemOffset = e.NumberOfItems; 
                int endOffset = itemOffset + itemsPerRequest; 
                if (endOffset > coll.Count) 
                { 
                    endOffset = coll.Count; 
                } 
 
                for (int i = itemOffset; i < endOffset; i++) 
                { 
                    RPFirehouseUser user = coll[i]; 
                    /// Changed from FhuName to FhuUserId 5/6/08 JCK 
                    userRadComboBox.Items.Add(new RadComboBoxItem(user.FhuStaffId + " " + user.FhuName, user.FhuId.ToString())); 
                } 
 
                if (coll.Count > 0) 
                { 
                    e.Message = String.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset.ToString(), coll.Count.ToString()); 
                } 
                else 
                { 
                    e.Message = "No matches"
                }  
            } 
        } 
        catch (Exception ex) 
        { 
            e.Message = "No matches"
        } 
    } 

Any help is appreciated!

1 Answer, 1 is accepted

Sort by
0
Jeff
Top achievements
Rank 1
answered on 04 Jul 2008, 12:13 AM
Nevermind, I figured out "MarkFirstMatch" needs to be "true".   Is this documented somewhere?
Tags
ComboBox
Asked by
Jeff
Top achievements
Rank 1
Answers by
Jeff
Top achievements
Rank 1
Share this question
or