I'm creating a properties panel with the RadGrid, allowing the properties of a column of a different grid to be viewed/edited.
However, when I try to edit a row, I'm seeing this error:
I've been looking for more information and I did see this thread: http://www.telerik.com/community/forums/aspnet-ajax/grid/telerik-radgrid-invalid-postback-or-callback-argument.aspx
I am using Advanced DataBinding, utilizing the NeedDataSource event so the solution there doesn't seem applicable. I do have ajax enabled, utilizing the AjaxManagerProxy on the page for the grid. At load, the NeedDataSource will bind to an empty arraylist. If a user clicks the column of a different grid, I utilize an ajax request to populate the datasource of this grid. I then DataBind(). This works fine.
Once I click the "edit" button on the grid row, that is when this issue arises. The edit button is within the radgrid that's erroring but maybe due to my process it's not "the control that originally rendered" the edit button?
Below are some code snippets. DisplayColumnProperties is what the ajax request comes back and ultimately calls. It's not applicable to clicking the "edit" button, but it is a special case so I included it.
GridColumnProperties_SetDataSource does not DataBind() as I think some might ask. It builds up a view model object dictionary and sets that to the datasource as well as setting the columnName in the viewstate.
Any insight is appreciated. Thank you.
However, when I try to edit a row, I'm seeing this error:
System.ArgumentException: 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.
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.ImageButton.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.ImageButton.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)
I've been looking for more information and I did see this thread: http://www.telerik.com/community/forums/aspnet-ajax/grid/telerik-radgrid-invalid-postback-or-callback-argument.aspx
I am using Advanced DataBinding, utilizing the NeedDataSource event so the solution there doesn't seem applicable. I do have ajax enabled, utilizing the AjaxManagerProxy on the page for the grid. At load, the NeedDataSource will bind to an empty arraylist. If a user clicks the column of a different grid, I utilize an ajax request to populate the datasource of this grid. I then DataBind(). This works fine.
Once I click the "edit" button on the grid row, that is when this issue arises. The edit button is within the radgrid that's erroring but maybe due to my process it's not "the control that originally rendered" the edit button?
Below are some code snippets. DisplayColumnProperties is what the ajax request comes back and ultimately calls. It's not applicable to clicking the "edit" button, but it is a special case so I included it.
public
void
DisplayColumnProperties(
string
uniqueName)
{
if
(CustomReport !=
null
&& !
string
.IsNullOrEmpty(uniqueName))
{
GridColumnProperties_SetDataSource(uniqueName);
gridColumnProperties.DataBind();
}
}
protected
void
GridColumnProperties_NeedDataSource(
object
sender, GridNeedDataSourceEventArgs e)
{
string
columnName = (
string
)
this
.ViewState[
"columnName"
];
if
(!
string
.IsNullOrEmpty(columnName))
{
GridColumnProperties_SetDataSource(columnName);
}
else
{
gridColumnProperties.DataSource =
new
ArrayList();
}
}
GridColumnProperties_SetDataSource does not DataBind() as I think some might ask. It builds up a view model object dictionary and sets that to the datasource as well as setting the columnName in the viewstate.
Any insight is appreciated. Thank you.