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

RadComboBox load data problem

6 Answers 180 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Sergey
Top achievements
Rank 1
Sergey asked on 05 Jan 2012, 02:15 PM
Hi,
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>        }
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?

6 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 05 Jan 2012, 02:54 PM
Hello Sergey,

I am not sure the way you implemented the scenario. The following link provides an online example on the same.
ComboBox / Load on Demand modes.

Thanks,
Shinu.
0
Ivana
Telerik team
answered on 06 Jan 2012, 01:23 PM
Hello,

The following help article might be of help too: (http://www.telerik.com/help/aspnet-ajax/combobox-load-on-demand-showmoreresultsbox.html).

Kind regards,
Ivana
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
0
Sergey
Top achievements
Rank 1
answered on 06 Jan 2012, 03:16 PM
Hello,
This example is not I really need. I need multycolumn combobox loading on demand. And as I understand the only way to do it out-of-the box - use ItemRequested event. Like in this example http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/multicolumncombo/defaultcs.aspx. It works correct on my local machine and on one test server but on the other servers it cycles and sends data requests one by one each 500ms. Even isolated on the empty page it doesn't works correct. The data returned from the server with each response is correct. What can cause that strange behaviur of the combobox?
0
Ivana
Telerik team
answered on 11 Jan 2012, 11:29 AM
Hi,

Could you send us a live URL of your website? Isolating the problem is even better -- you could send us a support ticket with the sample page attached to it, so we will be able to troubleshoot it locally.

Also, which are the servers you have deployed you website, on? What is version of our controls that you are using?

Kind regards,
Ivana
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
0
Sergey
Top achievements
Rank 1
answered on 11 Jan 2012, 01:15 PM
Hello,
After deep investigation we found out that this problem is caused by server responce archeiving. So combobox for some reason can not parse callback responce correct. If server archeive it's responce the responce contains the following header Transfer-Encoding:chunked.
The version we are using is 2010.2.929.35.
0
Ivana
Telerik team
answered on 13 Jan 2012, 04:53 PM
Hi Sergey,

Could you test this scenario with some of the newest versions of our controls and see if this behavior is the same?

Meanwhile, you could refer to the following forum thread discussing a similar problem: (http://www.telerik.com/automated-testing-tools/community/forums/test-studio-express/automation-framework/proxy-bug-with-transfer-encoding-chunked.aspx).

Regards,
Ivana
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
Tags
ComboBox
Asked by
Sergey
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Ivana
Telerik team
Sergey
Top achievements
Rank 1
Share this question
or