Hi,
I have RadComboBox
witch use the following methods for data loading:
But when I open it i see only loading message whitch never hides. If i close it and open it again I see all valid items immidetly but still see load message on the top of combobox. I looked on it behavior on such tools like fiddler2 and firebug and pointed out that once opened it sends requests to the server each ~500ms and they returned with 200 ok result and valid response but combobox continue requests sending. I don't have any errors or exceptions on both client and server side and any entries in windows event log. Has anybody the same problems or knows how to fix this strange behaviour or what can it cause?
I have RadComboBox
<
telerik:RadComboBox
ID
=
"combo"
runat
=
"server"
OnItemDataBound
=
"ItemDataBound"
AllowCustomText
=
"true"
<br> EnableTextSelection="true"<
br
> EnableEmbeddedBaseStylesheet="true"<
br
> ChangeTextOnKeyBoardNavigation="true" <
br
> CollapseAnimation-Type="InCubic" <
br
> DropDownWidth="298px"<
br
> EnableScreenBoundaryDetection="true" <
br
> MarkFirstMatch="true"<
br
> NoWrap="False" <
br
> Filter="None"<
br
> CausesValidation="false"<
br
> IsCaseSensitive="false" <
br
> EmptyMessage="--All--"<
br
> ShowDropDownOnTextboxClick="true" <
br
> HighlightTemplatedItems="True"<
br
> EnableLoadOnDemand="True"<
br
> ShowMoreResultsBox="True"<
br
> ShowToggleImage="True"<
br
> EnableVirtualScrolling="True"<
br
> OnItemsRequested="OnItemRequested"<
br
> OnClientSelectedIndexChanged="multiSelectedIndexChanged"<
br
> Height="200px"<
br
> Width="145px"><
br
></
telerik:RadComboBox
>
witch use the following methods for data loading:
protected void OnItemRequested(object sender, RadComboBoxItemsRequestedEventArgs e)<
br
> {<
br
> IList list = DataSourceFunc != null ? DataSourceFunc(e.Text) : new ArrayList();<
br
> if (GetEmptyItem != null && list.Count > 0)<
br
> {<
br
> list.Insert(0,GetEmptyItem());<
br
> }<
br
> int itemsPerRequest = ConfigCaller.DropDownPortionSize;<
br
> int startOffset = e.NumberOfItems;<
br
> int endOffset = Math.Min(startOffset + itemsPerRequest, list.Count);<
br
> var data = GetPortion(list, Math.Max(0, startOffset - 1), endOffset - Math.Max(0, startOffset - 1));<
br
> if (data.Count > 0)<
br
> {<
br
> combo.ClearSelection();<
br
> combo.DataSource = data;<
br
> combo.DataBind();<
br
> if (!String.IsNullOrEmpty(EmptyClass) && GetEmptyItem != null)<
br
> {<
br
> combo.Items[0].Attributes.Add("style", EmptyClass);<
br
> }<
br
> }<
br
> e.Message = list.Count > 0 ? String.Format("Items <
b
>1</
b
>-<
b
>{0}</
b
> out of <
b
>{1}</
b
>", endOffset, list.Count) : "No matches";<
br
> e.EndOfItems = endOffset == list.Count;<
br
> <
br
> }<
br
><
br
> private IList GetPortion(IList list, int start, int count)<
br
> {<
br
> var result = new ArrayList();<
br
> for (int index = 0; index <
list.Count
; index++)<br> {<
br
> var item = list[index];<
br
> if (index >= start && index <
start
+ count)<br> {<
br
> result.Add(item);<
br
> }<
br
> }<
br
> return result;<
br
> }