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

[Solved] EnableViewState="false" and ItemCommand

2 Answers 149 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rh
Top achievements
Rank 1
rh asked on 29 Oct 2009, 02:03 PM
I've been researching optimization tips and tricks and have been playing around with disabling viewstate on my grids. However, I've ran into an issue where the ItemCommand event doesn't fire when disabling viewstate. This is an issue for me because nearly all my grids are functional; i.e. they are not display only grids. I also use DataKeyNames quite extensively and am curious if this is affected by disabling viewstate.

So, I just wanted to verify that it is expected that ItemCommand will not fire when viewstate is disabled or if I'm doing something wrong.

2 Answers, 1 is accepted

Sort by
0
rh
Top achievements
Rank 1
answered on 29 Oct 2009, 02:41 PM
Finding more wierdness with this. Scenario:

Using a GridButtonColumn
Viewstate on grid is disabled
Have an ItemCommand event handler wired up to the grid

Scenario 1 - No confirm dialog on the GridButtonColumn

The item command event does not fire

Scenario 2 - Confirm dialog on the GridButtonColumn

Add a confirm dialog to the GridButtonColumn. I set mine to use RadWindow and configured text and title for the dialog.
The item command event fires in this case.

The problem is that I don't want/need a confirm dialog but, of course, I need the item command event to fire.

NOTE: DataKeyNames does seem to work with viewstate disabled so that is good!!!
0
Vlad
Telerik team
answered on 03 Nov 2009, 10:32 AM
Hello rh,

Disabling ViewState is not an option in complex controls like RadGrid - finally you will end with basic functionality! Better will be to get rid of ViewState (or compress) using RadCompression.

Best wishes,
Vlad
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.
Tags
Grid
Asked by
rh
Top achievements
Rank 1
Answers by
rh
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or