Adding a completely custom Paging area did not appeal to me. Probably could not decipher it in a short enough time.
I am exploring adding a control to the Paging area using the following code:
Sub SectionDataGrid_ItemCreate
' Get the newly created item
Dim itemType As ListItemType = e.Item.ItemType
' Is it the pager?
If (itemType = ListItemType.Pager) Then
' Extract the Pager
Dim pager As TableCell = CType(e.Item.Controls(0), TableCell)
' Add Cell to Row to Hold Row Count Label
Dim newcell As TableCell = New TableCell
newcell.ColumnSpan = 1
newcell.HorizontalAlign = HorizontalAlign.Right
newcell.Style("border-colo
' Add Button
Dim navigationButton As Button = New Button
navigationButton.ID = "Go_To_XXX"
newcell.Controls.Add(navig
' Add Table Cell to Pager
e.Item.Controls.AddAt(0, newcell)
' Subtract from Colspan of Original Pager to Account for New Row
pager.ColumnSpan = pager.ColumnSpan - 1
End If
End Sub
The button I want appears as it should, but a new, sort of "blank" column appears at the right side of the datagrid, and at the base of that, in the paging area, is the original paging mechanism.
I want the original paging mechanism on the left side of the paging area, and the button on the right without that extra "column".
What can I do to make that happen?
Main Topics
Browse All Topics





by: Justin_WPosted on 2007-08-14 at 17:09:45ID: 19696426
Yes, but it is sometimes more work than it is worth. The PagerStyle tag controls all of the easily-configurable options for the default paging area of a DataGrid, and adding additional controls to that area is not one of the options. (See http://msdn2.microsoft.com /en-us/lib rary/ syste m.web.ui.w ebcontrols .datagrid. pagerstyle .aspx) Therefore, you would have to dynamically add controls to that area in order to add any new content. See here for an example: m/web/Arti cles/ShowA rticle.asp x? article= 187
om/Tutoria l/EA868776 -D71E-448A - BC23-B64B 871F967F.d cik
http://www.dotnetcoders.co
However, another option is to simply build a completely custom Paging area rather than use the default one. See here for an example:
http://www.dotnetjunkies.c