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

[Solved] telerik RadComboBox error message "capacity was less than the current size."

4 Answers 379 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
wissam
Top achievements
Rank 1
wissam asked on 25 Dec 2008, 02:35 PM

I am receiving the error message"capacity was less than the current size.Parameter name: capacity"
  when selecting one of the comboboxitems and then click on the next page link (combobox bottom)


 
This is the properties which I set
<
telerik:RadComboBox ID="cbDistrict" runat="server" DataTextField="DistrictName"

 

 

 

DropDownWidth="200px" MaxHeight="200px" DataValueField="DistrictId"

 

 

EnableLoadOnDemand="true" EnableVirtualScrolling="true" ShowMoreResultsBox="true" Width="153px"

 

 

 

EnableItemCaching="true" OnClientItemsRequesting="OnDistrictItemsRequesting"

 

 

OnClientSelectedIndexChanged="OnDistrictSelectedIndexChanged" OnClientTextChange="OnDistrictTextChange"

 

 

 

OnClientLoad="OnDistrictComboBoxLoaded">

 

 

 

4 Answers, 1 is accepted

Sort by
0
Beth Krawczuk
Top achievements
Rank 1
answered on 13 Jan 2009, 07:19 PM

I had received this error too.

I was using load on demand with a webservice. 

The error came when the user typed some information into the textbox.  The attribute “MarkFirstMatch” caused the dropdown to select an item and the call back to the webservice now had conflicting information in the amount of records. So removing the attribute “MarkFirstMatch” was all it took to prevent the error.

Sorry I don’t have more detailed information, I meant to post this yesterday when I was in front of the scenario.

My scenario seems to be a little bit different from yours I just wanted to make notes on the same error.

Thanks,
Beth

0
Simon
Telerik team
answered on 14 Jan 2009, 01:49 PM
Hi there,

I tried to reproduce the issue with the current information without success.

Could you provide the ComboBox code and declaration which are needed to fully reproduce the issue so that I could do so at my side?

Ideally open a support ticket and send us a running project or a page which exhibit the issue - we will inspect it right away.

Thank you in advance for your co-operation.

Greetings,
Simon
0
wissam
Top achievements
Rank 1
answered on 23 Apr 2009, 11:43 AM
Hi,
this bug can be produced on your demo site http://demos.telerik.com/aspnet-ajax/combobox/examples/populatingwithdata/autocompletesql/defaultcs.aspx , please  make sure that you do the steps to produce exactly as the following :

1 -selecting one of the comboboxitems

2- click on the next page link (combobox bottom)

Note : try the second combo box , it seems occurred only if there is huge number of items in the combo box.
0
Atanas Korchev
Telerik team
answered on 23 Apr 2009, 01:40 PM
Hi wissam,

The problem was in the example itself. The WebService had a problem trying to instantiate a List() object with negative capacity (App_Code/Product.cs):

result = new List<RadComboBoxItemData>(endOffset - itemOffset);

To fix it you can change it like this:

result = new List<RadComboBoxItemData>();

Kind regards,
Albert
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
ComboBox
Asked by
wissam
Top achievements
Rank 1
Answers by
Beth Krawczuk
Top achievements
Rank 1
Simon
Telerik team
wissam
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or