Re: DataGrid Paging - Page x of N
Yeah, my question is regarding placement also.
I got the 'Page x of n' to go into the footer, but it places it right next to 'Prev Next.' How would I specify one to go on one side of the footer, and the other to go on the other side of the footer?
Here is my code for the two items mentioned above:
public void ChangePage(object sender, DataGridPageChangedEventArgs objArgs)
{
dgFiles.CurrentPageIndex = objArgs.NewPageIndex;
dgFiles.DataSource = alBad;
dgFiles.DataBind();
}
public void CustomPager(object sender, DataGridItemEventArgs e)
{
// PAGER STUFF
int currentPage = dgFiles.CurrentPageIndex +1;
int totalPages = dgFiles.PageCount;
string strNewPager = "Page " + currentPage + " of "
+ totalPages;
if(e.Item.ItemType == ListItemType.Pager)
{
TableCell pager = (TableCell)e.Item.Controls[0];
pager.Controls.AddAt(0,new LiteralControl(strNewPager));
}
}
Thanks,
Craig