PC Review


Reply
Thread Tools Rate Thread

Datagrid and Pagging

 
 
Ricardo Manuel
Guest
Posts: n/a
 
      28th Jul 2003
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
..


 
Reply With Quote
 
 
 
 
Marina
Guest
Posts: n/a
 
      28th Jul 2003
You have to handle the page changing event in the datagrid, and write your
own code to advance to the next page.

"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
> .
>
>



 
Reply With Quote
 
Scott M.
Guest
Posts: n/a
 
      29th Jul 2003
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
> .
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MVVM: Single datagrid row selection when a datagrid contains anotherdatagrid in side RowDetailsTemplate Sunita@.NET Microsoft C# .NET 0 12th Nov 2010 09:03 AM
How to add a Dropdown list to a datagrid at runtime (dynamic) without using template columns in ASP.NET and still have the ability to us the datagrid Update event. Daniel Roth Microsoft Dot NET Framework 0 5th Apr 2005 04:54 AM
Filling One DataGrid Based on Selection from Another DataGrid - Both in Separate User Controls thegame Microsoft ASP .NET 1 28th Feb 2005 04:23 PM
No Pagging fiels Error on boot up win2K PC Umesh Microsoft Windows 2000 1 14th Sep 2004 08:08 PM
Added CheckBox to a DataGrid Doesn't work with DataGrid.Enabled=False Amar Microsoft ASP .NET 0 6th Apr 2004 11:14 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:14 PM.