With a customgridview using LoadMethodParameters, the gridview will load successfully the first time the page is loaded. But when using the paging or sorting links the following error occurs: System.MissingMethodException
...method not found.
This error does not happen for any method without parameters. It's as if these parameters are lost.
Here is the code:
Code:
if (!IsPostBack)
{
cgvKBArticles.ListClassName = typeof(KBArticleEOList).AssemblyQualifiedName;
cgvKBArticles.LoadMethodName = "LoadByTopic";
cgvKBArticles.LoadMethodParameters.Add(topicId);
cgvKBArticles.AddBoundField("", "Actions", "");
cgvKBArticles.AddBoundField("TopicName", "Topic", "TopicName");
cgvKBArticles.DataBind();
}
(topicId is an int from the querystring)
If I remove the IsPostBack if statement, the paging/sorting works on the above example but the gridview columns get duplicated.
I noticed that the methodparameters are not stored in viewstate in the CustomGridView class. Is this causing the problem or am I missing something else?
Thanks in advance.