RadComboBox not firing itemsrequested after item selected

5 posts, 0 answers
  1. Damian Chen
    Damian Chen avatar
    6 posts
    Member since:
    Sep 2009

    Posted 24 Jan 2010 Link to this post

    I have my ItemsRequested handler working where on start of the page, this method gets hit and it loads the first set of items.  Scrolling through the list works well and each new page is requested and starts loading.

    However, if I go into the combo box and right away I starting typing something which does not appear in the first page of results, the item is listed but I am no longer able to change the results and see the new matches appear in the list of the combo box.

    The list is approx. 3,000 records, here are the relevant snips:

     

    protected void RadComboBoxMedicationName_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)

     

    {

     

    Database db = DatabaseFactory.CreateDatabase();

     

     

    RadComboBox r = sender as RadComboBox;

     

     

    DbCommand cmd = db.GetSqlStringCommand("SELECT Id, Description FROM refMedType WHERE Description LIKE '" + e.Context["Text"].ToString() + "%'");

     

     

    DataTable data = (DataTable)(db.ExecuteDataSet(cmd)).Tables[0]; ;

     

     

    try

     

    {

     

    int itemsPerRequest = 25;

     

     

    int itemOffset = e.NumberOfItems;

     

     

    int endOffset = itemOffset + itemsPerRequest;

     

     

    if (endOffset > data.Rows.Count)

     

    {

    endOffset = data.Rows.Count;

    }

     

    if (endOffset == data.Rows.Count)

     

    {

    e.EndOfItems =

    true;

     

    }

     

    else

     

    {

    e.EndOfItems =

    false;

     

    }

     

    for (cint i = itemOffset; i < endOffset; i++)

     

    {

    r.Items.Add(

    new RadComboBoxItem(data.Rows[i]["Description"].ToString(), data.Rows[i]["Description"].ToString()));

     

    }

     

    if (data.Rows.Count > 0)

     

    {

    e.Message =

    String.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset.ToString(), data.Rows.Count.ToString());

     

    }

     

    else

     

    {

    e.Message =

    "No matches";

     

    }

    }

     

    catch (Exception ex)

     

    {

    e.Message =

    "No matches";

     

    }

    }


     

     

    <telerik:RadComboBox ID="RadComboBoxMedicationName" ShowWhileLoading="true" EmptyMessage="Enter medication name" Text='<%# Bind( "MedicationName" ) %>' LoadingMessage="Loading..." runat="server" Width="250px" Height="200px" AllowCustomText="True" ShowMoreResultsBox="true" EnableLoadOnDemand="True" MarkFirstMatch="True" OnItemsRequested="RadComboBoxMedicationName_ItemsRequested" EnableVirtualScrolling="true" />

     

     

     

     

     

    <asp:RequiredFieldValidator ID="RequiredFieldValidatorMedicationName" runat="server" ControlToValidate="RadComboBoxMedicationName" Display="Dynamic" ErrorMessage="RequiredFieldValidator" ToolTip="Medication required."><br />* Medication required.</asp:RequiredFieldValidator>

     

     

     

  2. Damian Chen
    Damian Chen avatar
    6 posts
    Member since:
    Sep 2009

    Posted 24 Jan 2010 Link to this post

    Found the issue - was a bug in the control as listed in the release notes.  Fixed in later versions, but for now you can use the script to set endofitems to false
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. nirav
    nirav avatar
    4 posts
    Member since:
    Dec 2010

    Posted 11 Jan 2011 Link to this post

    I would like to know from which version the issue has been resolved.
    I am using version "2010.1.309.20" and facing the same issue. Although the issue occurs very rarely say 1 out of 20 attempt.

    It occurs specially when I type complete text matching an item (regardless of existence of item on same page or next or any other page, however, I found that issue occurs bit frequently for items not on same page.) As I type the complete text in filterbox, that makes the text unique to match exactly with one and only one item from the combo list.

    I tried to play with grid on the demo site and was able to reproduce the issue.
    http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandcombo/defaultcs.aspx?product=grid
  5. Luis Barahona
    Luis Barahona avatar
    23 posts
    Member since:
    Feb 2005

    Posted 20 Apr 2011 Link to this post

    anyone?, I was using the version 2010.3.1304.20 in one of my projects, and suddenly the itemrequested on my radcomboboxes stopped working, I don't know why, and actually if I run the same project with the same Telerik dlls on the server then the radcombobox works fine. I'm not sure, if it is because I installed on my local machine the RadControls for ASP.NET AJAX Q1 2011, that's the only difference between my local machine and the server, and as I mentioned before those controls were working fine...
    anyone?
  6. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 26 Apr 2011 Link to this post

    Hi Luis,

    Since this problem seems to be related to your specific scenario and you have already opened a support ticket, we will continue the discussion there.

    If the problem turns to be a general one, I'll share the solution here.

    Best wishes,
    Dimitar Terziev
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017