This is a migrated thread and some comments may be shown as answers.

In paging, ViewState is lost.

5 Answers 136 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Carlos Rodriguez
Top achievements
Rank 1
Carlos Rodriguez asked on 23 May 2011, 05:00 PM
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

5 Answers, 1 is accepted

Sort by
0
Gimmik
Top achievements
Rank 1
answered on 23 May 2011, 06:14 PM
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
0
Carlos Rodriguez
Top achievements
Rank 1
answered on 23 May 2011, 06:36 PM
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.
0
Gimmik
Top achievements
Rank 1
answered on 23 May 2011, 06:47 PM
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
0
Carlos Rodriguez
Top achievements
Rank 1
answered on 23 May 2011, 09:42 PM
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.
0
Carlos Rodriguez
Top achievements
Rank 1
answered on 24 May 2011, 03:53 PM
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
Tags
Grid
Asked by
Carlos Rodriguez
Top achievements
Rank 1
Answers by
Gimmik
Top achievements
Rank 1
Carlos Rodriguez
Top achievements
Rank 1
Share this question
or