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

RadGrid with disabled Page State

3 Answers 57 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Grendizer
Top achievements
Rank 1
Grendizer asked on 29 Oct 2008, 07:17 AM

I’m trying to use the RadGrid in a Page with disabled ViewState.

 

<%@ Page Language="C#" AutoEventWireup="true" EnableViewState="false" %>

 

Here’s my scenario:

·         My page contains a RadGrid with  EditMode="EditForms" and a  <rad:GridEditCommandColumn /> column.

·         When clicking on this column, the edition starts as it should.

·         On the next postback – might be not even due to a grid event – the grid “forgot” is has entered edit mode and the form is not displayed anymore.

 

I understand the behaviour since I’ve deactivated the ViewState. I’d like to maintain this information in the server in a custom way. My question is how do I hook the grid’s server-side events to tell it that it is in edit mode ?

 

I’ve found the following example on your community site:

 

http://www.telerik.com/community/code-library/submission/b311D-tgtkd.aspx

 

Although this example does not rely on the ViewState for the current data of the grid, it relies on the ViewState for the “edit” mode.

 

Thanks

3 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 31 Oct 2008, 09:06 AM

Hi Grendizer,

Does disabling the ViewState of the master table in the grid as shown in the referenced example (instead of the entire page ViewState) maintains the grid item in question in edit mode? If so, consider disabling the viewstate of the grid in this way in order to perform data editing operations.

Best regards,

Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Grendizer
Top achievements
Rank 1
answered on 04 Nov 2008, 09:28 AM

Yes, the edit item does remain if the grid viewstate is disabled (both grid and masterview). The page viewstate is the one that seems to be needed. My question was about how to maintain (or recreate) the edit item manually at each postback when the page’s viewstate is disabled.

 

Best regards,

0
Rosen
Telerik team
answered on 06 Nov 2008, 02:43 PM
Hi Grendizer,

You may consider storing the edited item's index into a session variable and explicitly setting the item into edit mode on postback. Please refer to the attached page for simple implementation of this approach.

Sincerely yours,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Grendizer
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Grendizer
Top achievements
Rank 1
Rosen
Telerik team
Share this question
or