Just because you've changed the DataGrid's interface to support or "Enable"
paging, doesn't mean that the functionality is automatic, it just means that
you'll have the buttons (or hyperlinks) that a user can click. You still
must write the code for the PageIndexChanged event that fires when someone
clicks the paging button (or hyperlink).
See code below (by the way the same concept is true when you enable sorting
in the DataGrid - - I've included that code as well):
Private Sub dg_PageIndexChanged(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles
dg.PageIndexChanged
dg.CurrentPageIndex = e.NewPageIndex
dg.DataBind()
End Sub
Private Sub dg_SortCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles
dg.SortCommand
Dim dv As New DataView(dsCusts.Tables(0))
dv.Sort = e.SortExpression
dg.DataSource = dv
dg.DataBind()
End Sub
"Ricardo Manuel" <(E-Mail Removed)> wrote in message
news:056601c354f1$254905e0$(E-Mail Removed)...
> Hi,
> I'm using a Datagrid that I fill with a Dataset but
> when I configure the paging with the Navigation Buttons I
> can't put them working, I've tried both methods (Next,
> Previous and Page Numbers) when I click on the Next link
> of the navigation buttons I see on status bar the
> folowing code -> Javascript:__doPostBack('Datagrid1$_ctl9
> $_ctl1','') but nothing happens on Datagrid.
>
> I've configured the datagrid for 5 rows and Dataset
> returns about 20 rows.
>
> Thanks in advance
> Ric
> .
>
>
|