Gridview in XmlHttpPanel

2 posts, 0 answers
  1. Mansi
    Mansi avatar
    63 posts
    Member since:
    Feb 2009

    Posted 11 Jan 2010 Link to this post


    I am using a grid view inside XmlHttpPanel.
    My issue is regarding call back.
    Above the grid, there is one dropdown list and one radiobuttonlist, and on their selectedindexchanged event, client side, I am setting the value of the panel, and it binds the grid at server side.

    For the first time say, it is binding the grid from the database and all works well, then I change the value in dropdownlist, so it again binds the grid according to the value selected in dropdown.
    Additionally, I have one button below the grid, on its click event at server side, I am generating a datatable and storing it in a session. The issue creates when I press that button.
    Now I am pressing the button below the grid. This does the post back (which opens a popup to show preview of the grid), and it  rebinds the grid (on the parent page) again without calling the .databind() - and that is which it bound before from the database .

    XmlHttpPanel, does not support this kind of scenario ?
  2. Pero
    Pero avatar
    1156 posts

    Posted 12 Jan 2010 Link to this post

    Hi Mansi,

    I am not sure that I completely understand your scenario, but please consider the following information and if it does not help please send us a fully working project (you must open a support ticket to be able to attach files, or you can paste the full source code in this thread)  that demonstrates the problem and we'll do our best to provide a working solution.

    The XmlHttpPanel uses client callbacks (or WebService) to update its content. This means that the page will not go through its full life-cycle when its content is loaded, as in the case with AJAX postbacks. Additionally there is no ViewState, so if you perform a postback the content inside the XmlHttpPanel might be lost (or inconsistent). I have created a sample project (attached to the thread) to demonstrate this. It has a GridView which is updated by the XmlPanel on a button client-click. Then after a postback to the server the content of the GridView is lost, because there is no ViewState.

    For additional info read the XmlHttpPanel's online documentation.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft R3 2016 release webinar banner
Back to Top