The load on demand for the combobox is not working once I move the page to the shared host. It works fine while testing it in Visual Studio.
Up on the shared host, when I click on the combobox, it drops down showing the items in the box. But, as soon as I type a single letter, the "Loading..." message appears and it just sits there. Even if I type the first letter of the first item in the box, it will show the loading message and then do nothing.
I tried both loading from server side, and also by setting the EnableAutomaticLoadOnDemand="true". The latter doesn't even load the list.
This will at least display the list:
This is the code-behind:
Up on the shared host, when I click on the combobox, it drops down showing the items in the box. But, as soon as I type a single letter, the "Loading..." message appears and it just sits there. Even if I type the first letter of the first item in the box, it will show the loading message and then do nothing.
I tried both loading from server side, and also by setting the EnableAutomaticLoadOnDemand="true". The latter doesn't even load the list.
This will at least display the list:
<
telerik:RadComboBox
ID
=
"CustomerSearch"
runat
=
"server"
Width
=
"180"
Height
=
"160"
MarkFirstMatch
=
"true"
AllowCustomText
=
"true"
CssClass
=
"CustomerSearch"
EnableLoadOnDemand
=
"true"
EnableVirtualScrolling
=
"true"
OnItemsRequested
=
"CustomerSearch_ItemsRequested"
OnClientSelectedIndexChanged
=
"searchnav"
EmptyMessage
=
"Select a customer"
DataSourceID
=
"dsCustomer"
DataTextField
=
"CustomerName"
DataValueField
=
"NavPath"
BackColor
=
"White"
Skin
=
"Forest"
/>
<
asp:SqlDataSource
ID
=
"dsCustomer"
runat
=
"server"
SelectCommand
=
"CustomerSearchName"
SelectCommandType
=
"StoredProcedure"
>
</
asp:SqlDataSource
>
<
telerik:RadScriptBlock
ID
=
"RadScriptBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function searchnav(sender, args) {
var iframe = document.getElementById('ctl00_iMainPages');
iframe.src = sender.get_value();
}
</
script
>
</
telerik:RadScriptBlock
>
This is the code-behind:
Protected Sub CustomerSearch_ItemsRequested(sender As Object, e As RadComboBoxItemsRequestedEventArgs)
Dim dal As New Customer
Dim data As DataTable = dal.CustomerSearchName(Session("StoreID"), e.Text).Tables(0)
Dim itemOffset As Integer = e.NumberOfItems
Dim endOffset As Integer = Math.Min(itemOffset + 10, data.Rows.Count)
e.EndOfItems = endOffset = data.Rows.Count
For i As Integer = itemOffset To endOffset - 1
CustomerSearch.Items.Add(New RadComboBoxItem(data.Rows(i)("CustomerName").ToString(), data.Rows(i)("NavPath").ToString()))
Next
e.Message = GetStatusMessage(endOffset, data.Rows.Count)
End Sub
Private Shared Function GetStatusMessage(ByVal offset As Integer, ByVal total As Integer) As String
If total <= 0 Then
Return "No matches"
End If
Return [String].Format("Items <
b
>1</
b
>-<
b
>{0}</
b
> out of <
b
>{1}</
b
>", offset, total)
End Function