I am trying to use the ObjectDataSource with enabled paging. This requires me to use the SelectCountMethod (so the grid can know how many pages there are). My ObjectDataSource looks like this:
<asp:ObjectDataSource ID="ItemsDataSource" runat="server" SelectMethod="GetContentGridItems"
TypeName="ContentItemExtensions" SelectCountMethod="GetContentGridItemsCount" EnablePaging="True">
<SelectParameters>
<asp:QueryStringParameter Name="contentItemID" QueryStringField="cid" DbType="Guid" />
<asp:QueryStringParameter Name="contentTypeID" QueryStringField="tid" Type="String" />
<asp:QueryStringParameter Name="contentTypeGroup" QueryStringField="tgid" Type="String" />
<asp:QueryStringParameter Name="parentItemID" QueryStringField="pcid" DbType="Guid" />
<asp:QueryStringParameter Name="parentFieldID" QueryStringField="pfld" type="String" />
</SelectParameters>
And the corresponding static class looks like this:
public static class ContentItemExtensions
{
public static DataTable GetContentGridItems(Guid? contentItemId,string contentTypeID, string contentTypeGroup, Guid? parentItemID, string parentFieldID,int maximumRows, int startRowIndex)
public static int GetContentGridItemsCount(Guid? contentItemId,string contentTypeID, string contentTypeGroup, Guid? parentItemID, string parentFieldID)
}
All is working fine when I don't use paging but when I enable paging I get the following exception which clearly states what it needs:
ObjectDataSource 'ItemsDataSource' could not find a non-generic method 'GetContentGridItemsCount' that has parameters: contentItemID, contentTypeID, contentTypeGroup, parentItemID, parentFieldID.
My method has these parameter and is non generic so I don't have a clue. Can anyone help me?