I have run into a problem where I am doing a databind and it causes invalid postback errors in the system events log. I am doing the rebind to change the appearance of the grid. i.e. turn of sort, display on line in grid not 20, hide a couple columns etc.. I am not changing the underlying data that has been selected. Calling the databind sometime causes errors. Is there a way to refresh the appearance of the grid without using the databind?
Event error being generated.
RadGrid1.AllowSorting = false; // Turn off column sorting when in Display mode
RadGrid1.Columns[c1ASelectFile].Visible = false; // Hide "Select View" Column
RadGrid1.Columns[c1APrintFile].Visible = false; // Hide "Print" Column
RadGrid1.ClientSettings.Resizing.AllowColumnResize = false;
RadGrid1.ClientSettings.Resizing.ResizeGridOnColumnResize = false;
RadGrid1.ClientSettings.Resizing.ClipCellContentOnResize = false;
RadGrid1.ClientSettings.AllowColumnsReorder = false;
RadGrid1.CurrentPageIndex = iRecord; // Set document to display
RadGrid1.PageSize = 1; // Set to one record per page when displaying document
RadGrid1.DataBind();
Event error being generated.
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 10/31/2011 3:43:14 PM
Event time (UTC): 10/31/2011 10:43:14 PM
Event ID: e83be8bc2dcb4fac96c0f6d752826fe9
Event sequence: 2063
Event occurrence: 5
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/1/Root/SpeechRecords-1-129645654292996087
Trust level: Full
Application Virtual Path: /SpeechRecords
Application Path: C:\WebSite\SpeechRecords\
Machine name: SVRTEONLINE
Process information:
Process ID: 97572
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE
Exception information:
Exception type: ArgumentException
Exception message: 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.
Request information:
Request URL: http://192.168.0.238/SpeechRecords/Records.aspx
Request path: /SpeechRecords/Records.aspx
User host address: 192.168.1.131
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE
Thread information:
Thread ID: 1
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument)
at System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Custom event details:
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.