Hi all ,
try this example to Create a GridView Paging Style with Code
to apply this example you should allow paging with Gridview then add the following code:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Pager)
{
TableRow tRow = e.Row.Controls[0].Controls[0].Controls[0] as TableRow;
foreach (TableCell tCell in tRow.Cells)
{
Control ctrl = tCell.Controls[0];
if (ctrl is LinkButton)
{
LinkButton lb = (LinkButton)ctrl;
lb.Width = Unit.Pixel(15);
lb.BackColor = System.Drawing.Color.DarkGray;
lb.ForeColor = System.Drawing.Color.White;
lb.Attributes.Add("onmouseover","this.style.backgroundColor='#4f6b72';");
lb.Attributes.Add("onmouseout","this.style.backgroundColor='darkgray';");
}
}
}
}
Hope this helps
Good Luck.