In paging, ViewState is lost.

6 posts, 0 answers
  1. Carlos Rodriguez
    Carlos Rodriguez avatar
    72 posts
    Member since:
    Aug 2009

    Posted 23 May 2011 Link to this post

    Hello!

    I'm using the ViewState, I added paging to Radgrid. When I change page, ViewState is lost. What I can do to avoid this incident happen?

    Greetings
    Carlos Rodríguez
  2. Gimmik
    Gimmik avatar
    170 posts
    Member since:
    May 2011

    Posted 23 May 2011 Link to this post

    Hi Carlos,

    Which part of the viewstate is being lost? When you page a RadGrid I don't think any party of the Grid's viewstate is kept. Everything would be associated with the previous page anyway, and thus not relevant to the current page. Are other controls on the page losing their state?

    -Gimmik
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Carlos Rodriguez
    Carlos Rodriguez avatar
    72 posts
    Member since:
    Aug 2009

    Posted 23 May 2011 Link to this post

    Gimmik Hello!

    I'm using the ViewState of the page, when I change the page of Radgrid, ViewState is lost, it is as if closing the page and reload.

    If you do not get the page, everything works fine, but when the RadGrid is paging, when changing the page loses all the ViewState.

    I'm looking for a way to avoid this without using session variables.
  5. Gimmik
    Gimmik avatar
    170 posts
    Member since:
    May 2011

    Posted 23 May 2011 Link to this post

    Hi Carlos,

    I just created a simple page with a RadGrid and a RadTextBox. I bound the grid to the sample NorthWind database and enabled paging. After I loaded the page I typed "ViewState" into the RadTextBox and then paged the RadGrid. I did not lose my viewstate for the RadTextBox.

    Can you provide me with steps to reproduce your issue?

    -Gimmik
  6. Carlos Rodriguez
    Carlos Rodriguez avatar
    72 posts
    Member since:
    Aug 2009

    Posted 23 May 2011 Link to this post

    Gimmik Hello!

    of course, the steps are:

    1 .- I do a query to the database, I get a DataSet with data.
    2 .- The dataset obtained I store in ViewState.
    3 .- The same dataset assigned it to the DataSource property of RadGrid.
    4 .- When I change page in RadGrid paging, the ViewState disappeared.

    Note: Use asp TextBox with data, the data is lost.
  7. Carlos Rodriguez
    Carlos Rodriguez avatar
    72 posts
    Member since:
    Aug 2009

    Posted 24 May 2011 Link to this post

    I've already changed the asp controls of telerik, however, I have 2 screen RadGrid in a RadGrid has pagination, to flipping through pages, data is lost. Data from one DataTable stored in ViewState.

    When I change page, the URL changes:
    ... / MovProdCEDIS.aspx    to     ... / movProdCEDIS.aspx? Ctl00_Contenido_radGriRecMerProSeleccionadoChangePage = 2
    This could be the cause? How I can resolve it without having to stop using the ViewState?

    Regards!
    Carlos Rodriguez
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017