RadComboBox lose items on PostBack

4 posts, 0 answers
  1. Jesus
    Jesus avatar
    1 posts
    Member since:
    Jul 2009

    Posted 26 Jul 2013 Link to this post


    Here is the situation: I have a RadComboBox (not LoadOnDeman) which is filled with values when I load the page:

    <telerik:RadComboBox ID="drpCollectingScript" runat="server" Height="150px" Width="225px"
    DropDownWidth="360px" HighlightTemplatedItems="true" Filter="Contains" AutoPostBack="False"
    MarkFirstMatch="true" OnClientKeyPressing="setHighlightedItem"
    OnClientBlur="setId" OnClientFocus="toggleRadCombo" ViewStateMode="Enabled">
        <table style="width: 340px" cellspacing="0" cellpadding="0">
            <td style="width: 340px;">
              <asp:Label ID="lblCSCode" runat="server">Code</asp:Label>
        <table style="width: 340px" cellspacing="0" cellpadding="0">
            <td style="width: 340px;">
              <%# DataBinder.Eval(Container, "Attributes['Code']")%>


    If Me.IsPostBack = False Then
      Dim scripts = New CatalogService().GetAllScriptTips()
      For i As Integer = 0 To scripts.Count - 1
        Dim item As New RadComboBoxItem()
        item.Text = scripts(i).Code
        item.Value = scripts(i).ScriptTipId
        item.Attributes.Add("Code", scripts(i).Code)
        item.Attributes.Add("Script", scripts(i).ContentDesign)
    End If

    The problem is that if I don't make a Postback that refreshes the table element in which the RadComboBox is contained (using RadAjaxManager) within aproximately 2 minutes after loading the page, then the RadComboBox loses all of its items and this problem extends aswell to the asp:DropDownList controls which are contained within the same table element.

    So, what's the problem here? What can I do to solve this problem?
  2. Nencho
    Nencho avatar
    1446 posts

    Posted 31 Jul 2013 Link to this post

    Hello Arturo,

    I tried to replicate the described issue, but to no avail. I had prepared a sample page for you, demonstrating the behavior at my end. Would you give it a try at your end and let me know if I had missed something. Please find the attachment.

    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 the blog feed now.
  3. DevCraft R3 2016 release webinar banner
  4. Jacob
    Jacob avatar
    1 posts
    Member since:
    Nov 2014

    Posted 05 Aug 2015 in reply to Nencho Link to this post

    I'm having exactly the same issue that I can consistently reproduce.

     I looked at your code...

    Can you please explain this line: item.DataBind()?

     Are you calling DataBind() method on RadComboBoxItem?

  5. Ivan Danchev
    Ivan Danchev avatar
    788 posts

    Posted 10 Aug 2015 Link to this post

    Hello Arturo,

    The DataBind() method is called on the RadComboBoxItems so that the Template can use the custom attributes in its data-binding expressions. 

    Were you able to reproduce the issue in the sample project my colleague Nencho attached in his previous reply? If you were, could you please post your modifications so we can further investigate the reason for the observed behavior?

    Ivan Danchev
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top