在ItemCreate事件里加入下面代码
ListItemType elemType = e.Item.ItemType; ////////////////// Pager ///////////////////////////
//
if (elemType == ListItemType.Pager) 
{
// The pager as a whole has the following layout:
//
// <TR><TD colspan=X> ... links ... </TD></TR> 
//
// Item points to <TR>. The code below moves to <TD>.
TableCell pager = (TableCell) e.Item.Controls[0]; // Loop through the pager buttons skipping over blanks
// (Blanks are treated as LiteralControl(s)
for (int i=0; i<pager.Controls.Count; i+=2) 
{
Object o = pager.Controls[i];
if (o is LinkButton) 
{
LinkButton h = (LinkButton) o;
h.Text = "[ " + h.Text + " ]"; 
}
else
{
Label l = (Label) o;
l.Text = "Page " + l.Text; 
}
}

解决方案 »

  1.   

    这样写是不是太麻烦了,最好是能在页面上直接写或者套用css什么的,拜托了!显示的形式比如当前选择的页面的数字下面多一条下划线或者字体的颜色不一样,诸如这样就可以了。
      

  2.   

    你是不是用的DataGrid 的属性生成器呀,我的里面都这么用,是可以的实现你说的选中那一页,就可以在那一页数字上有一条线。你试试再说吧。