Tuesday 19 February 2013

Telerik RadGrid Pager error (Invalid postback or callback argument. Event validation is enabled using "" in configuration or <%@ Page EnableEventValidation="true" %> in a page.)

If u got Error like:

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.

To Solve this type of error do then following code in page load and bind the radgid

Code Here:
protected void Page_Load(object sender, EventArgs e)
{
  try
  {
    if (!IsPostBack)
    {
      radGrid1.DataSource = dt;
      radGrid1. DataBind ();
    }
  }
  catch (Exception ex)
  {
    Logger.LogError(ex);
  }
}