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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top