Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Reading all the rows of a datagrid that is using paging...

Reply
Thread Tools

Reading all the rows of a datagrid that is using paging...

 
 
Bob Morvay
Guest
Posts: n/a
 
      05-03-2005
This should be simple but I am stuck. I am trying to read all the rows of
my datagrid across all the pages. I can read all the rows on the page that
I am on but I can't seem to figure out how to iterate through all the pages.
Can anyone lend some insight. Here is the basic code that I am using to
attempt to read all the rows...

Private Sub btnUpdate(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnUpdate.Click
Dim item As DataGridItem
For Each item In DataGrid1.Items
ID = Convert.ToInt32(DataGrid1.DataKeys(item.ItemIndex) )
UpdateTable()
Next
End Sub

My example datagrid has 3 pages. This code will only update the database
with the items on the page that I am on when I click the update button. I
need it to iterate through all the pages of the datagrid for all the items.

Thanks in advance.




 
Reply With Quote
 
 
 
 
Bob Morvay
Guest
Posts: n/a
 
      05-03-2005
I figured it out. I had to set the currentpageindex of the datagrid, rebind
my data and I can iterate through all the pages via the datagrid pagecount.

"Bob Morvay" <> wrote in message
news:O%23waeM$...
> This should be simple but I am stuck. I am trying to read all the rows of
> my datagrid across all the pages. I can read all the rows on the page
> that I am on but I can't seem to figure out how to iterate through all the
> pages. Can anyone lend some insight. Here is the basic code that I am
> using to attempt to read all the rows...
>
> Private Sub btnUpdate(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles btnUpdate.Click
> Dim item As DataGridItem
> For Each item In DataGrid1.Items
> ID = Convert.ToInt32(DataGrid1.DataKeys(item.ItemIndex) )
> UpdateTable()
> Next
> End Sub
>
> My example datagrid has 3 pages. This code will only update the database
> with the items on the page that I am on when I click the update button. I
> need it to iterate through all the pages of the datagrid for all the
> items.
>
> Thanks in advance.
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
Reading all the Rows in a Column using DataReader Mattyw ASP .Net 2 09-12-2005 08:55 AM
convert rows to columns and columns to rows helpful sql ASP .Net 0 05-19-2005 06:03 PM
Reading all the rows of a datagrid that is using paging... Bob Morvay ASP .Net 1 05-03-2005 03:52 PM
script for moving rows up and down and traverse thru rows of HTML table Subba Rao via DotNetMonster.com ASP .Net 0 03-19-2005 06:46 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57