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

When disabled viewstate, 'Edit' not working

1 Answer 146 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Warren Rumak
Top achievements
Rank 1
Warren Rumak asked on 09 Jun 2014, 01:06 AM
Hi Sir,

I put the Grid on the usercontrol, I have to set the usercontrol enabledviewstate="false", the problem is now the  OnItemCommand="MyGrid_ItemCommand" not fired or not triggered, that means when I click 'Edit' or other commandbutton ,nothing happen, If I set the enabledviewstate = 'true' for the usercontrol, everything works fine, but I need to disable the viewstate for whole usercontrol,  do you have some suggetions about this issue? how can I trigger/fire the OnItemCommand event when whole usercontrol  'EnableViewState'  is false.
Thanks

Regards

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 09 Jun 2014, 04:29 AM
Hi Warren Rumak,

This is an expected behavior, RadGrid does NOT manage the state for user control when its EnableViewState property is set to false. To workaround it you have to stop the viewstate of the grid's parent control. For example you can place the grid inside a panel and stop its viewstate.

ASPX:
<asp:Panel runat="server" EnableViewState="false">
 <telerik:RadGrid ID="RadGrid1" runat="server" ... >
      ...
 </telerik:RadGrid>
</asp:Panel>

You can take a look at this article for more information on ViewState.

Thanks,
Princy
Tags
Grid
Asked by
Warren Rumak
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or