Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question about setting up Paging Header

Status
Not open for further replies.

DLLHell

Programmer
May 9, 2003
69
0
0
US
I have this method to build the Paging numbers for a datagrid since for some reason the collection containing the page numbers is not in perfect sequence e.g.

1 2 3 4 5 6 7 8 9 10 11 12 13 32 33 34 35 36 14 15 16 ....
- debugging showed that the ItemCreated event for Pagers is being invoked more than once.

The method I am using overrides the above problem, listing the page numbers in perfect sequence. However I am having trouble finding out how to put spaces in between the numbers... right now the output I generate is like this:

12345678910111213141516171819.....to last page number.

How can I put an "nbsp;" or blank value between the page numbers?
My code which is in the ItemCreated event is below:


if (e.Item.ItemType == ListItemType.Pager)
{

TableCell pager = (TableCell) e.Item.Controls[0];
TableCell newPager = new TableCell();
newPager.ColumnSpan = 99;

// Move the controls from the old Pager to the new Pager
for (int i = 0; i < (pager.Controls.Count); i++)
{
newPager.Controls.AddAt(i, pager.Controls);
}

// Remove the old Pager bar
e.Item.Controls.RemoveAt(0);

// And add the new one
e.Item.Controls.AddAt(0, newPager);

}

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top