Page number caption?

  • Thread starter Thread starter LL
  • Start date Start date
L

LL

Hi,

I'm using DBGrid.

Can I add a caption "Page:" in front of the PageNumber:
Page: 1.2....

Thanks.
 
Yes you can. You have to find the Pager row and stick the
literal Page in their.

To do that wire the datagrid's ItemCreated event with the
following method.

private void dgTest_ItemCreated(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
try
{
if (e.Item.ItemType == ListItemType.Pager)
{
TableCell pc = new TableCell();
pc = (TableCell)e.Item.Controls[0];
string strPg = "<b>Page: </b>";
pc.Controls.AddAt(0, new
LiteralControl(strPg));
}
}
catch()
{

}
}

That should do it.
Suresh.
 
Back
Top