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

Viewstate issue with Grid

3 Answers 177 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sridhar
Top achievements
Rank 1
Sridhar asked on 17 Jun 2008, 07:28 PM
Hi,

I am using the RadGrid to populate data. I am creating the columns dynamically using TemplateColumns. I am also adding GridEditCommandColumn and GridButtonColumn for Edit and delete of each row. I have disabled the viewstate for the grid since I will be creating the columns everytime and binding to grid. When I disable viewstate and click on edit or delete button, I get the following error. I know it is about viewstate being corrupted since I have disabled the viewstate. Any workaround for this?

Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

Sridhar

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 18 Jun 2008, 06:10 AM
Hi Sridhar,

Go through the following forum link which discusses a similar error.
Invalid postback or callback argument

Thanks
Princy.
0
Sridhar
Top achievements
Rank 1
answered on 18 Jun 2008, 01:42 PM

Hi Princy,

Thanks for the mail. I was earlier using a radgrid in design time. I was

adding the columns dynamically. Now I have made everything as dynamic

and it seems to have solved the problem to a greater extent. But still I

would like to know if I disable viewstate for the grid, how can I get

the buttons working. because it seems if I disable the viewstate for the

grid, it is throwing invalid postback error.

Your help is highly appreciated.

Thanks,

Sridhar

0
JustinWong
Top achievements
Rank 1
answered on 18 Dec 2008, 02:35 AM

Hi Sridhar and Princy:

I'm wondering if a solution has been found to this issue.  Basic I encounter the same problem. When the viewstate of the grid is disabled, I get the error. If I enable the grid's viewstate, then I don't get the error.

 

Does this mean that every grid that doesn't use viewstate needs to be dynamically created if used in conjunction with Ajax?  I'd hope not!

 

Justin

Tags
Grid
Asked by
Sridhar
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Sridhar
Top achievements
Rank 1
JustinWong
Top achievements
Rank 1
Share this question
or