You can use the PagerTemplate to designate the markup you'd like to use for the paging control. I'm not sure exactly what you're trying to do in terms of displaying the paging information as as ul/li, but this should be enough to start you on the right track. Sorry for the code running long to the side...
ex:
<asp:DataPager ID="DataPager1" runat="server" PagedControlID="gridInvoiceHistory"
PageSize="20">
<Fields>
<asp:TemplatePagerField>
<PagerTemplate>
Page
<asp:Label runat="server" ID="labelCurrentPage" Text="<%# Container.TotalRowCount > 0 ? (Container.StartRowIndex / Container.PageSize) + 1 : 0 %>" />
of
<asp:Label runat="server" ID="labelTotalPages" Text="<%# Math.Ceiling ((double)Container.TotalRowCount / Container.PageSize) %>" />
</PagerTemplate>
</asp:TemplatePagerField>
EDIT: here is a more detailed beginning to a solution for this:
<asp:TemplatePagerField>
<PagerTemplate>
<asp:BulletedList ID="listPages" runat="server"
DisplayMode="HyperLink" onclick="listPages_Click">
</asp:BulletedList>
</PagerTemplate>
</asp:TemplatePagerField>
And here is what you would have in the code-behind:
protected void listPages_Click(object sender, BulletedListEventArgs e)
{
var pageNo = int.Parse((sender as BulletedList).Items[e.Index].Text);
var startIndex = (pageNo - 1) * DataPager1.PageSize;
DataPager1.SetPageProperties(startIndex, DataPager1.PageSize, true);
}
What remains for you to do is to perform a databinding on the bulleted list against a method that gets the page count and returns an IEnumerable list of the text you want for the page links. Standard warning: this is sample code, and probably shouldn't be used in a production environment without a thorough vetting! :)