473,383 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Server control for tabled dataset results?

MU
Hello

I would like to take a dataset of Products and their Product photo and
display it on the page in a table format where there are 4 columns and
as many rows as needed. Therefore, if my dataset returned 20
products, there would be 5 rows of 4 columns, ie. 5 rows of Product
pictures.

Any thoughts on what control I should use and roughly how I would go
about doing it?

Thanks so much
MU
Oct 22 '08 #1
2 1032
I would probably use the Repeater control. As for your 4 column situation,
you will probably need to do some manipulation using either the ItemCreated
or ItemDataBound events. My basic suggestion would be to have the template
include the <td></tdtags (and all the stuff between them that display the
product), and use the e.Item.ItemIndex property to determine whether you
need to programmatically insert a <trat the beginning of the template, a
</trtag at the end of the template, or neither. You will also need to add
code to include any empty <td></td>'s (for example, if you have 18 products
you will need 2 empty <td></td>'s). The reason for all this extra manual
calculation is the fact that you are retrieving your product data with one
product per record, but you want a table with 4 products per row. Good Luck!
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"MU" <mi*****@lonelyprogrammer.comwrote in message
news:a3**********************************@t65g2000 hsf.googlegroups.com...
Hello

I would like to take a dataset of Products and their Product photo and
display it on the page in a table format where there are 4 columns and
as many rows as needed. Therefore, if my dataset returned 20
products, there would be 5 rows of 4 columns, ie. 5 rows of Product
pictures.

Any thoughts on what control I should use and roughly how I would go
about doing it?

Thanks so much
MU

Oct 22 '08 #2
MU
On Oct 22, 1:16*am, "Nathan Sokalski" <njsokal...@hotmail.comwrote:
I would probably use the Repeater control. As for your 4 column situation,
you will probably need to do some manipulation using either the ItemCreated
or ItemDataBound events. My basic suggestion would be to have the template
include the <td></tdtags (and all the stuff between them that display the
product), and use the e.Item.ItemIndex property to determine whether you
need to programmatically insert a <trat the beginning of the template, a
</trtag at the end of the template, or neither. You will also need to add
code to include any empty <td></td>'s (for example, if you have 18 products
you will need 2 empty <td></td>'s). The reason for all this extra manual
calculation is the fact that you are retrieving your product data with one
product per record, but you want a table with 4 products per row. Good Luck!
--
Nathan Sokalski
njsokal...@hotmail.comhttp://www.nathansokalski.com/

"MU" <mich...@lonelyprogrammer.comwrote in message

news:a3**********************************@t65g2000 hsf.googlegroups.com...
Hello
I would like to take a dataset of Products and their Product photo and
display it on the page in a table format where there are 4 columns and
as many rows as needed. *Therefore, if my dataset returned 20
products, there would be 5 rows of 4 columns, ie. 5 rows of Product
pictures.
Any thoughts on what control I should use and roughly how I would go
about doing it?
Thanks so much
MU
Worked awesome! I just had a test at the beginning of the
ItemTemplate and after my <TDtags to test a MOD to see if it was 0
at the beginning or ItemIndex - 1 for the end, if so, I added a <TR>
or </TR>!

Thanks
MU
Oct 22 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Henrique Berenguel | last post by:
Hello folks. How do I solve the problem below? when my program executes the line below : Package.WriteXml(Server.MapPath(strID + ".XML")); Ireceive the following error message: ...
9
by: dennist685 | last post by:
I created a web project named 'Access' in C:\Inetpub\wwwroot\Access and dropped an .mdb there. I dragged a DetailView to the form, configured it to show two fields of a table, and got...
1
by: momo | last post by:
Hello Guys, I am getting this error " Control 'oGrid__ctl14__ctl1' of type 'DataGridLinkButton' must be placed inside a form tag with runat=server." Here is my code and I don't know where...
11
by: John J. Hughes II | last post by:
I have a DataGridView displaying data from a DataSet. To the right of that I have a custom user control which displays one of the data set fields. The custom user control is bound to the data set...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
9
by: fniles | last post by:
I am using VB.NET 2003 and SQL 2005. To use connection pooling and avoid the error "There is already an open DataReader associated with this Connection which must be closed first." , I understand...
1
by: Ken Fine | last post by:
I have set up Microsoft Search Server 2008 Express. I want to know how I can query against it and return results in a form that can be bound to ASP.NET controls like ListViews. If there's simply...
3
by: shobhitguptait | last post by:
How to Run C#.NET Windows App on N/W with centralized DB using SQL SERVER 2000 Hello All...i m really grate full to c such a website where developers try to help people like us who face problems...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.