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

FIX: Items loaded on demand can be added multiple times on scroll (Q3 2009 issue)

0 Answers 141 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Telerik Admin
Top achievements
Rank 1
Iron
Telerik Admin asked on 05 Nov 2009, 04:00 PM
Hi guys,

We introduced a small problem in the Q3 2009 (2009.3.1103) in the load on demand mechanism.

Who is affected:
All scenarios where:
EnableLoadOnDemand = True and
EnableVirtualScrolling
or ShowMoreResults properties are not set to True (it is False by default).

If there is a scrollbar on the dropdown and you scroll to the bottom of the items list - another request is send to the server and the items are loaded again thus multiplying the items.


Workaround:
There are several easy workarounds (choose one of them):

1. Set the _virtualScroll private member of the combobox to false. This can be done in the OnClientLoad event of the combobox:

function onClientLoadHandler(sender, e) { 
    sender._virtualScroll = false


2. Set the EndOfItems property to True.
  • In ItemsRequested event this property is a member of the RadComboBoxItemsRequestedEventArgs class:
     
protected void RadComboBox1_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e) 
    DataTable data = GetData(e.Text); 
     
    // ... 
 
    e.EndOfItems = true

  • In PageMethods mode this property is a member of the RadComboBoxData class:

[WebMethod] 
public static RadComboBoxData GetCompanyNames(RadComboBoxContext context) 
    DataTable data = GetData(context.Text);          
    RadComboBoxData comboData = new RadComboBoxData(); 
 
    // ... 
 
    comboData.Items = result.ToArray(); 
    comboData.EndOfItems = true
 
    return comboData; 

  • In WebService mode this property is a member of the RadComboBoxData class:
[WebMethod] 
public RadComboBoxData GetCompanyNames(RadComboBoxContext context) 
{    
    RadComboBoxData comboData = new RadComboBoxData(); 
 
    // ... 
 
    comboData.Items = result.ToArray(); 
    comboData.EndOfItems = true
 
    return comboData; 


What is next
The problem is already fixed and will be available in the next Latest Internal Build and the first service pack.

We apologize for the caused inconvenience.
Tags
ComboBox
Asked by
Telerik Admin
Top achievements
Rank 1
Iron
Share this question
or