in ItemDataBound event:
if (e.Item.ItemType == ListItemType.Pager)
{
foreach (Control c in e.Item.Cells[0].Controls)
{
if (c is Label && ((Label)c).Text == (DataGrid1.CurrentPageIndex + 1).ToString())
{
((Label)c).ForeColor = Color.Red;
}
}
}try it.
if (e.Item.ItemType == ListItemType.Pager)
{
foreach (Control c in e.Item.Cells[0].Controls)
{
if (c is Label && ((Label)c).Text == (DataGrid1.CurrentPageIndex + 1).ToString())
{
((Label)c).ForeColor = Color.Red;
}
}
}try it.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货