Author |
Topic  |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 05 December 2003 : 17:31:56
|
Can someone actually tell me what this VB.Net code does ? :
<asp:DataList runat="server" id="dlPictures" RepeatColumns="4" RepeatDirection="Horizontal"
Width="600" CellPadding="5" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<%# Container.DataItem %>
</ItemTemplate>
</asp:DataList>
The only thing I can see that relates is this code in Sub Page_Load:
dlPictures.DataSource = pics
dlPictures.DataBind()
This code results in this page : http://www.v8central.com/LFS/default2.aspx
But I don't want ALL the items on the one page, I want to create (e.g.) 4 items on a page. I have written paging code in ASP, but I don't understand the .Net constructs used here, and how I can loop through them.
|
|
webfreak
New Member

71 Posts |
Posted - 09 December 2003 : 03:28:15
|
use DATAGRID not DATALIST.
set AllowPaging to True in DATAGRID. |
I am always doing that which I can not do, in order that I may learn how to do it. |
 |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 09 December 2003 : 03:32:49
|
OK, I'll try that, but does a DataGrid have paging built in ? (I'll google some more as well) |
 |
|
DavidRhodes
Senior Member
   
United Kingdom
1222 Posts |
Posted - 09 December 2003 : 03:48:24
|
The Datagrid doesn't use "RepeatColumns" though. The Datagrid is capable of paging but you still have to code the event handlers |
The UK MkIVs Forum |
 |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 09 December 2003 : 07:54:11
|
OK, as you said David, there is no Repeatcolumns now. Is there any way to loop through the members, so I can address each one individually ? |
 |
|
DavidRhodes
Senior Member
   
United Kingdom
1222 Posts |
Posted - 09 December 2003 : 08:12:27
|
quote: Originally posted by laser
Is there any way to loop through the members, so I can address each one individually ?
A DataGrid basically binds a DataTable to a HTML Table so each DataRow in the DataTable represents a TableRow in the HTML Table.
So, lets say you want 20 images on a page, 5 wide by 4 high, if you could build up a DataTable with 5 Columns and 4 DataRows you could accomplish this.
There's probably loads of ways to do it but that's what i'd probably do. |
The UK MkIVs Forum |
 |
|
laser
Advanced Member
    
Australia
3859 Posts |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 09 December 2003 : 18:16:49
|
OK, I got over that error FINALLY found out that I needed to include the System.Data namespace, now I'm trying to create a Binary array but Binary doesn't seem to be a recognised datatype  |
 |
|
DavidRhodes
Senior Member
   
United Kingdom
1222 Posts |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 09 December 2003 : 19:01:59
|
Thanks David I realised the mistake in my last post - i.e. there is no way I need a Binary datatype, it was String 
I think I've got it completely working now     but I still have a lot of work to go before it is 'finished'  |
 |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 10 December 2003 : 06:45:08
|
OK, definite progress being made     http://www.v8central.com/lfs/default2.aspx but can I customise the paging at all ? I've done as much as I can read about but does it look ok, or does it need that extra "ooomph" ? |
 |
|
DavidRhodes
Senior Member
   
United Kingdom
1222 Posts |
Posted - 11 December 2003 : 06:06:28
|
Any chance of sharing the code, i'd like to use it as a gallery on my forum. What do you need to customise on the paging? |
The UK MkIVs Forum |
 |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 11 December 2003 : 06:19:48
|
quote: Originally posted by DavidRhodes
Any chance of sharing the code, i'd like to use it as a gallery on my forum.
I was actually going to productise it, but I'll get in touch via email
quote: What do you need to customise on the paging?
I just want it to look a bit 'sexier' than it does. Highlight more that is is indeed the page controls (I can see a lot of my users not realising that there is several pages to view, even just a "Pages : " before the numbers would be a start. |
 |
|
DavidRhodes
Senior Member
   
United Kingdom
1222 Posts |
Posted - 11 December 2003 : 06:23:39
|
quote: I was actually going to productise it
good idea, best thing to do would be to make it a server control that accepts parameters such as "image root", "no. to display" etc then people can add it to their page easily. |
The UK MkIVs Forum |
 |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 11 December 2003 : 06:59:24
|
You have mail !  |
 |
|
DavidRhodes
Senior Member
   
United Kingdom
1222 Posts |
|
|
Topic  |
|