private void MyDataGrid_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
ListItemType lit_item=e.Item.ItemType;
TableCell tc_item=(TableCell)e.Item.Controls[0];
if (lit_item==ListItemType.Pager)
{
for (int i=0;i {
object obj_item=tc_item.Controls[i];
if (obj_item is LinkButton)
{
LinkButton lbn_item=(LinkButton)obj_item;
lbn_item.Text=lbn_item.Text;
lbn_item.Font.Size=10;
lbn_item.ForeColor=Color.FromName("#666666");
lbn_item.Attributes.Add ("onmouseover","currentcolor=this.style.color;this.style.color='#14AC05'");
lbn_item.Attributes.Add("onmouseout","this.style.color=currentcolor");
}
else
{
Label lbl_item=(Label)obj_item;
lbl_item.ForeColor=Color.Blue;
lbl_item.Font.Bold=true;
lbl_item.Font.Underline=true;
lbl_item.Text="" + lbl_item.Text + "";
lbl_item.Font.Size=10;
}
}
}
}
您可能感兴趣的文章: