How to retrieve Items server side after postback

3 posts, 0 answers
  1. Simon
    Simon avatar
    2 posts
    Member since:
    May 2012

    Posted 30 May 2012 Link to this post

    I'm using the RadListbox to edit a list of data client side, but need to retrieve the list on postback on the server.

    From the server side I populate the list using the Items property. The list display well client side and using javascript I can reorder the list, add item and remove item.

    Since the list is modified client side, i need to retrieve the modified list on the server. But I haven't found a way to do this. The Items property of the RadListBox is alway empty after the postback. How can I achieve this with the RadListBox? Is this something possible or should I add my own hidden control to keep track of everything?

    thank you
  2. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 31 May 2012 Link to this post

    Hello Simon,

    In order to preserve the changes made on the client, the trackChanges and commitChanges methods should be used. Please refer to the following help article here under the Preserving changes section.

    Kind regards,
    Dimitar Terziev
    the Telerik team
    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 their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Simon
    Simon avatar
    2 posts
    Member since:
    May 2012

    Posted 31 May 2012 Link to this post

    Hello,

    Using the example found in this thread : http://www.telerik.com/community/forums/aspnet-ajax/listbox/reading-dynamically-added-data-on-postback.aspx.

    I was able to have what I wanted. I use the RadListBox in a custom control that is after added in a page. The example was about the radListBox aded directly in the page. So I create the most simple custom control with only one RadLIstBox inside and one property to expose the RadListBox and it was not working.

    The problem was that the RadListBox was added in the CreateChildControl function. When I move the creation and the add in the constructor everything start working. The list modified client-side is now available using the Items property in the button event (After postback).
Back to Top