RadComboBox items disappearing after postback

24 posts, 0 answers
  1. Rajeev
    Rajeev avatar
    44 posts
    Member since:
    Feb 2008

    Posted 14 May 2008 Link to this post

    Hai,

        I don't know what going with my rad combo box, i am had a user control which i am binding one rad combo box using a link list. i had setted if(!this.post back) bind the combo box, after when i a post back, items in the rad combo get disappeared, Is there any properties or anything to do reload data in the rad combo. I can't reload the original data, because i am using check box as item template. i need to show the checked check boxes inside it.

    Please help me, it's not delivering what i  expected :)
  2. Nikolay
    Admin
    Nikolay avatar
    3997 posts

    Posted 14 May 2008 Link to this post

    Hi Rajeev,

    Is it possible that you are loading the items on demand (via callback, in the ItemsRequested event). If this is the case, then you should keep into account that the items added this way persist only at the client-side. This is done for a better performance. These items will disappear after postback. If you need the items to persist at the server, you need to add them outside the ItemsRequested event. 

    Greetings,
    Nick
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rajeev
    Rajeev avatar
    44 posts
    Member since:
    Feb 2008

    Posted 14 May 2008 Link to this post

    Hai,

          I am adding item by calling a method from a aspx page. Radcombobox.datasource = newLinkList;
    RadCombobox.DataBind();

    I have one checkbox and label inside the itemtemplate of the Radcombo

    <radC:RadComboBox ID="SearchIn" runat="server" Width="150px" NoWrap="true" Skin="WindowsXP" HighlightTemplatedItems="true" 
                            DataValueField="Reference" DataTextField="Name" OnClientSelectedIndexChanging="changing"
                            <ItemTemplate> 
                                <asp:CheckBox runat="server" ID="CheckBox" onclick="stopPropagation(event);" Text='<%# DataBinder.Eval(Container, "Text") %>'/>  
                                <asp:Label ID="lblSearchRef" runat="server" Text='<%# DataBinder.Eval(Container, "Text") %>' Visible="false" /> 
                                <asp:HiddenField ID="Searchrefval" runat="server" Value='<%# DataBinder.Eval(Container, "Value") %>' /> 
                            </ItemTemplate> 
                            <Items></Items
                           </radC:RadComboBox> 

    I am not useing any events of rad combo.

    Rajeev
  5. Nikolay
    Admin
    Nikolay avatar
    3997 posts

    Posted 14 May 2008 Link to this post

    Hi Rajeev,

    Is the problem that the items appear empty as your code looks correct except of the fact that you actually need to use <%# DataBinder.Eval(Container.DataItem, "Text") %>.

    Does this solve the problem? If not, could you put together a small and running project and attach the files to a new support thread? We will test them locally and try to find a working solution for you.

    Thanks for your time.

    Regards,
    Nick
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Rajeev
    Rajeev avatar
    44 posts
    Member since:
    Feb 2008

    Posted 14 May 2008 Link to this post

    Hai,

         I can't post a sample project, but i can write down the sample code that i used to bind the data.

    Method used to Bind the RadCombo.

     protected void PopulateSearchIn() 
            { 
                if (!this.IsPostBack) 
                { 
                    SearchIn.DataSource = this.Content.SearchInList; 
                    SearchIn.DataBind(); 
                    for (int nItemL = 0; nItemL < this.Content.SearchInList.Count; nItemL++) 
                    { 
                        if (Content.SearchInList[nItemL].Reference == "") 
                        { 
                            CheckBox SearchInSearchInChkL = SearchIn.Items[nItemL].FindControl("CheckBox") as CheckBox; 
                            Label TheRefLabelL = SearchIn.Items[nItemL].FindControl("lblSearchRef") as Label; 
                            if (SearchInChkL != null) 
                            { 
                                SearchInChkL.Visible = false
                                TheRefLabelL.Visible = true
                            } 
                        } 
                    } 
                } 
                 
            } 
    ascx code

     <radC:RadComboBox ID="SearchIn" runat="server" Width="150px" NoWrap="true" Skin="WindowsXP" HighlightTemplatedItems="true" 
                            DataValueField="Reference" DataTextField="Name" OnClientSelectedIndexChanging="changing"
                            <ItemTemplate> 
                                <asp:CheckBox runat="server" ID="CheckBox" onclick="stopPropagation(event);" Text='<%# DataBinder.Eval(Container.DataItem, "Name") %>'/>  
                                <asp:Label ID="lblSearchRef" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Name") %>' Visible="false" /> 
                                <asp:HiddenField ID="Searchrefval" runat="server" Value='<%# DataBinder.Eval(Container.DataItem, "Reference") %>' /> 
                            </ItemTemplate> 
                            <Items></Items
                           </radC:RadComboBox> 


    Rajeev
  7. Nikolay
    Admin
    Nikolay avatar
    3997 posts

    Posted 14 May 2008 Link to this post

    Hi Rajeev,

    This is indeed weird. You should make sure that your datasource actually contains the needed items. I prepared a really simple project for you that uses a datatable. I attached the files to this thread. Please download the files and give them a go.

    I hope this will get you started.

    Kind regards,
    Nick
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  8. Rajeev
    Rajeev avatar
    44 posts
    Member since:
    Feb 2008

    Posted 14 May 2008 Link to this post

    Hi Nick,

         Thanks for the best support. i checked u r sample code attached. it gave me some different idea. With that after a long fight i fixed the issue. issue is not with the rad combo.

    Thanks
    Rajeev
  9. Jake
    Jake avatar
    4 posts
    Member since:
    Sep 2007

    Posted 16 Jan 2009 Link to this post

    So how did you fix it then?
  10. Dennis Valencia
    Dennis Valencia avatar
    6 posts
    Member since:
    Nov 2005

    Posted 12 Mar 2009 Link to this post

    Telerik Team,

    I also have a problem with the drop down list in Combo Box, the list is there but I can't see it -
    It is "Transparent". I know its there, because the scroll bar actually moves up and down and I
    can see that the list has certain number of items. Also when I click I do get the .value back
    from the list so I know which item I selected.

    I tried chaging the backcolor, fore color properties but no luck.

    I wish I could have attach a pic here, that would have been better to explain this problem.

    FYI -
    I am using AJAX Combo box q3 08 version on Net 2.0, VS 2005, win 2000 op system.
    Please reply.


  11. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 12 Mar 2009 Link to this post

    Hello Dennis Valencia,

    Which browser do you use?
    Do you see any javascript errors on the page?

    Does the problem occurs on our online demos?

    Greetings,
    Veselin Vasilev
    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.
  12. Dennis Valencia
    Dennis Valencia avatar
    6 posts
    Member since:
    Nov 2005

    Posted 12 Mar 2009 Link to this post

    Telerik team,

    Thanks for your reply. I do not see any JavaScript error in general. I am using IE 6.0.2800.1106 (sp1).
    on the demo samples that you provided me  - I did get an error for 3rd combo box Page Methods -
    Select a company. (error - 'there was an error processing the request' when I click drop down arrow
    button). But I guess that was an issue with some programming functionality at your end.

    My problem with blank (transparent) drop drop list still persists. I am using JavaScript somewhere else in my project and that is working fine.

    Your help is always appreciated.
    thanks,
  13. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 16 Mar 2009 Link to this post

    Hello Dennis Valencia,

    We tested the example with IE 6 and everything worked as expected.

    I believe the best way to proceed is to send us a sample project (in a separate support ticket) demonstrating the issue. We will test it locally and find a working solution for you.

    Thanks

    Regards,
    Veselin Vasilev
    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.
  14. Angel
    Angel avatar
    3 posts
    Member since:
    Feb 2008

    Posted 09 Sep 2010 Link to this post

    Hi,

    I have the following problem:

    I'm using the RadComboBox control and I have a combo with tabular data in it. I have implemented two classes for header and for content in the table, inheriting ITemplate interface. I have the combo in a UpdatePanel! When I select a row for the first time from the combo it does what it have to do and it changes the selected item in the combo. But when I open the combo again the data in it is invisible, I still can click on a row and get data from the post back and it still changes the selected item for the combo. So actually the data is there, but it's not visible :S When I open firebug it's like this:

    <li class="rcbItem  rcbTemplate">
    <table width="100%">
    <tbody>
    <tr>
    <td width="240px"></td>
    <td width="80px"></td>
    <td width="80px"></td>
    <td width="80px"></td>
    </tr>
    </tbody>
    </table>
    </li>

    it's just empty!
  15. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 13 Sep 2010 Link to this post

    Hello Angel,

    Judging from this HTML the ItemTemplate is instantiated and the controls in it miss their data (which probably you supply in their respective DataBinding event handlers).

    Could you please compare your implementation of the ItemTemplate to that in this Code Library Project? Then please paste here the definition of the RadComboBox itself as well as the server-side code related to it (if any).

    All the best,
    Simon
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  16. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 13 Sep 2010 Link to this post

    Hi Angel,

    Here is the link to the Code Library Project - http://www.telerik.com/community/code-library/aspnet-ajax/combobox/dynamic-multi-column-template.aspx.

    Please excuse me for my omission.

    Best wishes,
    Simon
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  17. Angel
    Angel avatar
    3 posts
    Member since:
    Feb 2008

    Posted 14 Sep 2010 Link to this post

    Hi,

    Thanks for the answer! It works now :) What I did was adding items to the radcombobox in a loop. Now I am binding the data and it's ok. But now I'd like to have a "Choose..." option for first item in the radcombobox, how do I do that, since I'm binding the data!

    Regards,
    Angel
  18. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 14 Sep 2010 Link to this post

    Hi Angel,

    One way to achieve this is to subscribe to the DataBound event of the RadComboBox and insert the default Item at position 0 in the event handler.

    I hope this helps.

    Kind regards,
    Simon
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  19. Angel
    Angel avatar
    3 posts
    Member since:
    Feb 2008

    Posted 17 Sep 2010 Link to this post

    Hi Simon,

    Thanks for the answer! Now there is a "Chooose..." option, but the text only for it is not visible when the dropdown is collapsed! Any ideas how to work that out?

    Regards,
    Angel
  20. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 17 Sep 2010 Link to this post

    Hello Angel,

    Could you clarify how is the text not visible when the drop down is collapsed?

    Sincerely yours,
    Simon
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  21. Don
    Don avatar
    17 posts
    Member since:
    Aug 2010

    Posted 20 Oct 2010 Link to this post

    I'm certain that I'm working with a different version if Telerik given the dates of the posts but I'm putting this here so that others can find answers when searching for the same issue.  I am having the exact problem described in the post I'm responding to. I have a RadComboBox and on postback, the items in my combobox are "transparent" or invisible.  I've also determined that it is only a postback after an item is selected that triggers the behavior.  A postback triggered by another control leaves the items still visible.
      I know that the items are "transparent" because I can select in the blank space of the drop down list and it will select a different item.  I can scroll down the drop down list and pick another "invisible" item.  When the item is selected, it provides the appropriate item.SelectedValue which populates a list for a listbox (which is visible).  I've also stepped through and checked the datasource and can see the DataSet it's bound to.
      I've replicated this behavior in both IE8 and FireFox3.
      I'm using Q2 2010 (is that right, I don't know where to find the version number).

    I've attached a pic but it's not terribly helpful.

    Curiouser and Curiouser,

    As always, thanks for your help!

    Don
  22. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 25 Oct 2010 Link to this post

    Hello Don,

    Thank you for the additional info.

    What you describe is missing template markup in the drop down - the Items are there however they lack visual representation. Why this happens however is a mystery. The same use case works fine in our demos here. I tried disabling AJAX as well as setting the AutoPostBack property of the RadComboBox to true just to mimic your case without success - the control worked properly.

    Can you paste the markup of the RCB as well as any related code? Is the postback a normal or an AJAX one?

    Greetings,
    Simon
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  23. Basharat
    Basharat avatar
    8 posts
    Member since:
    Dec 2012

    Posted 14 Nov 2013 Link to this post

    Hello Admin,

    I am using RadComboBox in my application. I have used Load On Demand feature when user scroll down in the list inside rad combo box. 
    Its working fine. I have used check box true inside the list item. 

    I have thousands of item in the list, So I have used Load on demand feature. I want use Search feature, so user can search by entering text in the combobox then they can find quickly particular records. for this things below is demo given by you...

    http://demos.telerik.com/aspnet-ajax/combobox/examples/populatingwithdata/autocompletesql/defaultvb.aspx

    My problem is that when I am entering text in the combobox, text is stays just 1 or 1/2 seconds after that text is disappearing from the combobox.

    I have checked in your demo. You have not used Checkbox inside that list. When I remove checkbox from the list. Its working fine. I dont want to remove checkbox. As its a client requirement, I want to keep the selection of records from the list items.

    Please help me here.. I have lost my 6-7 hours to fix this issue, but problem is still there.
    Please let me know what cause here.

    Thanks,
  24. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 19 Nov 2013 Link to this post

    Hello Basharat,

    I am afraid that the scenario, you attempt to implement is not supported. The reason is that RadComboBox's items loaded on demand are not accessible on the server which is needed for the CheckBox feature. On the other hand, implementing a filter functionality with a CheckBoxes feature enabled is also not supported. This is because, when you check certain item, its text is appended in the input of the control, while the searching is implemented regarding the typed in the input text, which makes these two features incompatible. Here you could find our help article, describing the aforementioned limitations.

    Regards,
    Nencho
    Telerik
    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.
  25. Hiren
    Hiren avatar
    1 posts
    Member since:
    May 2013

    Posted 28 Nov 2014 in reply to Nikolay Link to this post

    As i was facing the same problem and i have gone through number of attempts to solve this problem. But no use. I am using Telerik.Web.UI. dll(2013.2.717.40),Telerik.Web.UI.Skin.dll(2013.2.717.40), Telerik.Web.Design(2013.1.417.35).
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017