In using the CSS Control Adapters on a paged GridView, initially all worked correctly. However, as soon as I added a PagerTemplate to the GridView markup, paging disappeared, never to return. I tracked this down to the WritePagerSection() method in GridViewAdapter, which apparently only has logic to process the <table> tags that the ASP.NET GridView normally uses for the built-in paging markup. I confirmed this by building a PagerTemplate like this:
<PagerTemplate><asp:Table ID="tmp" runat="server"><asp:TableRow runat="server"><asp:TableCell runat="server">
<asp:LinkButton Tooltip="Previous Page" CommandName="Page" CommandArgument="Prev" runat="server" ID="btnPrevious" OnCommand="Paginate" >Previous</asp:LinkButton>
</asp:TableCell></asp:TableRow></asp:Table></PagerTemplate>
which correctly outputs the paging section (no spaces or returns may be between PagerTemplate and the table tags or the WritePagerSection() logic sees the them as a Literal and ignores the PagerTemplate, or more precisely the contents of the Top/BottomPagerRow).
I'm not very familiar with the Template/ControlBuilder area of ASP.NET, but I think that by the time WritePagerSection() is called, Top/BottomPagerRow contains the parsed control array from PagerTemplate. I implemented else logic in WritePagerSection() to simply iterate over the Controls collection from Top/BottomPagerRow and call RenderControl (wrapping it all with a <div> as the existing logic does).
Is this a known issue? Is my simple solution of iterating over the controls array with RenderControl sufficient in all cases?
Thanks, Shane