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

Ondemand Radcombobox with RadTreeView in itemtemplate

1 Answer 40 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
andy asked on 12 Sep 2012, 06:28 AM
I would like to have a Radcomobox with load-on-demand turned on, and as the user is typing a search term in the input box of the combobox, instead of showing the results as a plain list, I would like the results to appear in a treeview. I am having a lot of difficulty in doing this.

I have gone through this forum post but it does not apply to my situation because I do not need to subscribe to nodeexpand event or nodeclick event. I need to subscribe to the combobox's itemsrequested event.

If this is too difficult, any suggestion for a similar solution will be appreciated, where as a user is typing a search term in a textbox, the results are being displayed in a treeview, but taking care to not cause a postback on every single key click (by building a small delay like the combobox does).

The error I am getting is: "Script control &#39'rtcICD9' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors(). Parameter name: scriptControl"

Here is my code:
<telerik:RadComboBox ID="ddlICD9Code" runat="server" Width="400px" MarkFirstMatch="true"
                                    AppendDataBoundItems="true" EnableLoadOnDemand="true" EnableItemCaching="true"
                                    MinFilterLength="3" ItemRequestTimeout="600"
                                    OnItemsRequested="ddlICD9Code_ItemsRequested" >
                                        <telerik:RadTreeView runat="server" ID="rtvICD9" DataFieldID="Id" DataFieldParentID="ParentId" DataValueField="Id" DataTextField="LongName">
                                                <telerik:RadTreeNodeBinding Depth="0" />
                                        <telerik:RadComboBoxItem />
protected void ddlICD9Code_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        string filterString = e.Text;
        if (filterString.Length >= 3)
            var qry = execute database query here;
            RadTreeView rtvICD9 = ddlICD9Code.Items[0].FindControl("rtvICD9") as RadTreeView;
            rtvICD9.DataSource = qry;

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 12 Sep 2012, 08:37 AM
Hello Andy,

The desired functionality is not part of the advertised functionality of the control and is not offered out-of-the box. Since the content of the ItemTemplate of RadComboBox, in this case,  is not a regular HTML element or asp server control, the only way to achieve this functionality is to define load-on-demand RadTreeView inside the RadComboBox's ItemTemplate as it is explained in the pointed by you forum thread.

The implementation of this functionality, as you have described it,  will require more time. Our recommendation in such cases is to contact our professional services:

I hope this is helpful!

All the best,
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question