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

Difference between ShowMoreResults and Load on Demand

1 Answer 50 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
CynthiaD
Top achievements
Rank 1
CynthiaD asked on 25 Aug 2008, 08:22 PM
Well, I hope that title makes sense.

I am using the load on demand feature, and  I want to be able to tell the difference between when the user starts to enter a string in the textbox, and the combo box does a MarkFirstMatch, and when the user clicks the "show more results" link at the bottom of the dropdown.

Both actions trigger the ItemsRequested event -- however, I want to do two different things in that event for the MarkFirstMatch and the ShowMoreResults click. But I can't figure out how to tell the difference.

I tried checking for [comboBox].Text == "", but if I have AllowCustomText set to false, this is never true.  I tried checking e.Text == "", but this is also never true even when the user clicks the "show more results" link.

Here's my combo box declaration:

            <telerik:RadComboBox
            ID="employeeBox"
            DataValueField="EmployeeDataID"
            DataTextField="Name"
            Width="350px" Height="300px"
            runat="server"
            Skin="WebBlue"
            ShowMoreResultsBox="true"
            ItemRequestTimeout="500"
            EnableLoadOnDemand="true"
            MarkFirstMatch="True"
            OnItemsRequested="employeeBox_ItemsRequested"
            >
                <CollapseAnimation Duration="200" Type="OutQuint" />
            </telerik:RadComboBox>

If someone could advise me as to how to accomplish this, I would be most appreciative!

1 Answer, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 26 Aug 2008, 07:19 AM
Hi ,

I suggest you hook on the OnClientItemsRequesting and check there the get_appendItems() property of RadComboBox. If it returns true then the request is a result of ShowMoreResultBox, if it returns false then the request is a result of a typing.

Example:
 function OnClientItemsRequesting(sender, eventArgs)  
 {  
   alert(sender.get_appendItems());  
 }  
 

Greetings,
Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ComboBox
Asked by
CynthiaD
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Share this question
or