GridView2.0\DisplayRecordsVertically

Discussion in 'ASP .Net' started by gh, Sep 25, 2008.

  1. gh

    gh Guest

    I am using .net 2.0 and have a gridview, with the pager set to 10
    records per page. I had a data list setup that displayed the contents
    of a record in one column. I wanted to be able to use a pager, to
    control the number of records per page, so I copied the template over
    to a gridview and pasted it into the gridview item template. When I run
    the web app. it displays the first 10 records as expected, but when I
    click on the pager to goto the next page or another, the pages are
    empty. Also I the pager selection count displays 1 through 10 and if I
    click the next arrow after 10, nothing happens. Is the gridview
    supposed to work, when displaying records in a cell this way?

    TIA
    gh, Sep 25, 2008
    #1
    1. Advertising

  2. gh

    Bogdan Guest


    > I had a data list setup that displayed the contents
    > of a record in one column.


    Is your intention to display each record as a gridview column and record's
    fields as gridview rows (as suggested by the title above)?
    Bogdan, Sep 25, 2008
    #2
    1. Advertising

  3. gh

    gh Guest

    Bogdan wrote:
    >> I had a data list setup that displayed the contents
    >> of a record in one column.

    >
    > Is your intention to display each record as a gridview column and record's
    > fields as gridview rows (as suggested by the title above)?
    >
    >
    >


    Bogdan:

    I have a table(DataGrid), with one column, that displays each record as
    a list. When the user clicks on the pager(next) the page refreshes with
    the next 10 photos. I would like to display 4 rows across and 4 rows
    down, with a pager. Each cell will contain an image, that is retrieved
    by the url stored in a record. If the user clicks on the pager, to go
    to the next set of records, then the datagrid will dislpay the next 16
    images. I hope this explains

    Thanks
    gh, Sep 25, 2008
    #3
  4. gh

    Bogdan Guest

    >
    > I have a table(DataGrid), with one column, that displays each record as a
    > list. When the user clicks on the pager(next) the page refreshes with the
    > next 10 photos. I would like to display 4 rows across and 4 rows down,
    > with a pager. Each cell will contain an image, that is retrieved by the
    > url stored in a record. If the user clicks on the pager, to go to the
    > next set of records, then the datagrid will dislpay the next 16 images. I
    > hope this explains
    >
    > Thanks


    I think I get it now.

    I can't see how you can utilize gridview and its paging capability without
    going through some heavy customization. The default paging works with rows
    but in your case there are no rows - just cells (not even columns).

    If I were you I'd leave the gridview's default behaviour alone and modify
    your object data source attached to the gridview so it supplies the info in
    rows and columns. You could still read your images/urls as records from a
    data store but you would pass them to the gridview as rows (i.e. 4 records
    per row). If you do it in your code-behind (e.g. in your bll) then you have
    a lot of flexibility.

    Also, try to test the default gridview paging before you template it.
    Simply enable the paging and make sure it works as expected first.

    Finally, maybe the gridview is not the best choice in this case.

    Bogdan
    Bogdan, Sep 26, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. egsdar
    Replies:
    0
    Views:
    3,084
    egsdar
    Nov 4, 2008
  2. PetroTiburcio

    Populates GridView2 based on selected row from GridView1

    PetroTiburcio, Jun 7, 2013, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    422
    PetroTiburcio
    Jun 7, 2013
Loading...

Share This Page