Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > GridView2.0\DisplayRecordsVertically

Reply
Thread Tools

GridView2.0\DisplayRecordsVertically

 
 
gh
Guest
Posts: n/a
 
      09-25-2008
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
 
Reply With Quote
 
 
 
 
Bogdan
Guest
Posts: n/a
 
      09-25-2008

> 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)?



 
Reply With Quote
 
 
 
 
gh
Guest
Posts: n/a
 
      09-25-2008
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
 
Reply With Quote
 
Bogdan
Guest
Posts: n/a
 
      09-26-2008
>
> 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


 
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




Advertisments