<color=red>if (e.Item.ItemType == ListItemType.Footer)</color>
{
LinkButton FirstPage = e.Item.FindControl("btfirst") as LinkButton;
LinkButton PrePage = e.Item.FindControl("btpre") as LinkButton;
LinkButton NextPage = e.Item.FindControl("btnext") as LinkButton;
LinkButton LastPage = e.Item.FindControl("btlast") as LinkButton;
if (pds.IsFirstPage)
{
FirstPage.Enabled = false;
PrePage.Enabled = false;
}
if (pds.IsLastPage)
{
NextPage.Enabled = false;
LastPage.Enabled = false;