Results 1 to 7 of 7

Thread: what's the deal with this datagrid?

  1. #1

    Thread Starter
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    I havent used it yet, but Paging is built into the Dataset/Datagrid stuff. TRy looking up some info here on it

    http://www.gotdotnet.com
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  2. #2
    Lively Member ac11965's Avatar
    Join Date
    May 2000
    Location
    East London, South Africa
    Posts
    69

    Question

    hi there

    when you look at the property page there is an option where you can select if you want to do it automatically or still manually.

    but as i'm a first time asp programmer (and so also asp.net) i would like to do it automatically. but it does'nt seem to work...

    my datagrid is binded to a dataset...

    any ideas?

  3. #3
    Lively Member
    Join Date
    Feb 2001
    Location
    KL Malaysia
    Posts
    64
    There are a few things you need to include to make paging work, even if it's automatic. Check out this:

    http://www.4guysfromrolla.com/webtech/072101-1.2.shtml

    boy you should search online... ASP .NET is new and resources are scarce but still I did learn paging from that page.

    oh by the way your code:
    Code:
    objRS.Open "SELECT * FROM MyTable" 
    
    While Not objRS.EOF 
    Response.Write objRS("myfield").Value 
    Wend 
    
    objRS.Close
    will crash the server! Check your code!

  4. #4
    Lively Member ac11965's Avatar
    Join Date
    May 2000
    Location
    East London, South Africa
    Posts
    69
    thanks for the paging site...

    as for the code -

  5. #5
    Lively Member ac11965's Avatar
    Join Date
    May 2000
    Location
    East London, South Africa
    Posts
    69
    ok, i got the automatic paging to work...

    but like the article says, the dataset gets reloaded from the database each time you page thru the grid.

    to not reload it, i must now manually go and look for the next 10 records and load it into my grid.

    my datagrid is binded to a dataset.
    is it easier to bind it to a dataview and read thru it? or can i just read thru my dataset?

  6. #6
    Member
    Join Date
    Dec 2000
    Posts
    53
    you can always response.write and go through the data set or datareader.

  7. #7
    Member
    Join Date
    Dec 2000
    Posts
    53
    Yes there is an old way to do the make the table in html you use the data reader and loop through the results using response.write to make your html table and having the data displayed

    get datareader

    loop through data reader
    response.write(html table data i)
    next

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width