Gridview numeric paging, how to insert 'page:' before numbers?

E

Edwin Knoppert

I simply want to insert a word before the numerics for paging..
*If* i need to manage this true a template then how to keep the numeric
stuff?
I was only able to prepare buttons which do adding and subtracting, i want
the numerics.

?
 
E

Edwin Knoppert

I could only come up with:

protected void GridView1_RowCreated(object sender, GridViewRowEventArgs
e)
{
if (e.Row.RowType == DataControlRowType.Pager)
{
TableCell tCell = new TableCell();
tCell.Text = "Pagina:";
tCell.Font.Bold = true;
e.Row.Cells.AddAt(0, tCell);
}
}

But this shifts the paging numbers to the next column.
Rather unwanted
 
Joined
May 6, 2007
Messages
1
Reaction score
0
Edwin Knoppert said:
I could only come up with:

protected void GridView1_RowCreated(object sender, GridViewRowEventArgs
e)
{
if (e.Row.RowType == DataControlRowType.Pager)
{
TableCell tCell = new TableCell();
tCell.Text = "Pagina:";
tCell.Font.Bold = true;
e.Row.Cells.AddAt(0, tCell);
}
}

But this shifts the paging numbers to the next column.
Rather unwanted


"Edwin Knoppert" <[email protected]> schreef in bericht
news:[email protected]...
>I simply want to insert a word before the numerics for paging..
> *If* i need to manage this true a template then how to keep the numeric
> stuff?
> I was only able to prepare buttons which do adding and subtracting, i want
> the numerics.
>
> ?
>
>
A revised version could solve the 'shifting' problem.
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs
e)
{
if (e.Row.RowType == DataControlRowType.Pager)
{
TableRow tr1 = e.Row.Cells[0].Controls[0].Controls[0] as TableRow;
if (tr1 != null)
{
TableCell tCell = new TableCell();
tCell.Text = "Page :";
tCell.Font.Bold = true;
tr1.Cells.AddAt(0, tCell);
}
}
}
 

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

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top