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 ''rtcICD9' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors(). Parameter name: scriptControl"
Here is my code:
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 ''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"
>
<
ItemTemplate
>
<
telerik:RadTreeView
runat
=
"server"
ID
=
"rtvICD9"
DataFieldID
=
"Id"
DataFieldParentID
=
"ParentId"
DataValueField
=
"Id"
DataTextField
=
"LongName"
>
<
DataBindings
>
<
telerik:RadTreeNodeBinding
Depth
=
"0"
/>
</
DataBindings
>
</
telerik:RadTreeView
>
</
ItemTemplate
>
<
Items
>
<
telerik:RadComboBoxItem
/>
</
Items
>
</
telerik:RadComboBox
>
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;
rtvICD9.DataBind();
}
}