在DataGrid的DataGrid_ItemCreated事件中添加以下代码:
 if(e.Item.ItemType == ListItemType.Pager)
   {
    TableCell pager = (TableCell) e.Item.Controls[0];

    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 = "第 " + l.Text + " 页";
     }
    }
   }
同时要设置分页模式为页码
------------------------------------------------------------------------------------------------
分页事件  
 try
   {
    this.DataGrid1.CurrentPageIndex = e.NewPageIndex ;
   }
   catch
   {
    this.DataGrid1.CurrentPageIndex = 0;
   }
数据绑定

相关文章:

  • 2021-11-23
  • 2022-02-24
  • 2021-12-21
  • 2022-01-27
  • 2022-12-23
  • 2021-11-12
猜你喜欢
  • 2021-05-20
  • 2022-12-23
  • 2021-10-04
  • 2021-06-17
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
相关资源
相似解决方案