473,320 Members | 2,024 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,320 software developers and data experts.

Need help displaying images dynamically in a table

I'm familiar with the Data Controls, however what I have is a website where
users can upload multiple pictures.

I want to display these pictures in a table, that has 3 columns in each row,
and for instance if a user has 3 pictures, one row of three pictures will
display, or if they have 5 pictures, 2 rows, the first with 3 pics and the
second with 2 pics will be rendered.

How can I do something like this?

Thanks for the help in advance,
tperri
Nov 19 '05 #1
2 1504
Hi tperri,

You can save urls of pictures in a datatable:

int N = number of pictures;
int numRows;
int numCols;
int numLastLine = N % 3;
if (numLastLine == 0)
{
numRows = N / 3;
numRows = 3;
}
else
{
numRows = (int)N / 3 + 1;
}
DataRow row;
for (int I = 0; I < numRows; I++)
{
row = pictureTable.NewRow;
if (I == numRows)
{
numCols = numLastLine;
}
else
{
numCols = 3;
}
for (int J = 0; J < numCols; J++)
{
row[J] = pictureUrl[3 * I + J];
}
imageTable.Rows.Add(row);
}

Then use datagrid (data source as above datatable) to show pictures.

HTH

Elton Wang
el********@hotmail.com
"tperri" wrote:
I'm familiar with the Data Controls, however what I have is a website where
users can upload multiple pictures.

I want to display these pictures in a table, that has 3 columns in each row,
and for instance if a user has 3 pictures, one row of three pictures will
display, or if they have 5 pictures, 2 rows, the first with 3 pics and the
second with 2 pics will be rendered.

How can I do something like this?

Thanks for the help in advance,
tperri

Nov 19 '05 #2
Thank you very much. I know the basics of the controls, but am just learning
how to use them outside of a textbook learning experience. Your help is much
appreciated.

"Elton W" wrote:
Hi tperri,

You can save urls of pictures in a datatable:

int N = number of pictures;
int numRows;
int numCols;
int numLastLine = N % 3;
if (numLastLine == 0)
{
numRows = N / 3;
numRows = 3;
}
else
{
numRows = (int)N / 3 + 1;
}
DataRow row;
for (int I = 0; I < numRows; I++)
{
row = pictureTable.NewRow;
if (I == numRows)
{
numCols = numLastLine;
}
else
{
numCols = 3;
}
for (int J = 0; J < numCols; J++)
{
row[J] = pictureUrl[3 * I + J];
}
imageTable.Rows.Add(row);
}

Then use datagrid (data source as above datatable) to show pictures.

HTH

Elton Wang
el********@hotmail.com
"tperri" wrote:
I'm familiar with the Data Controls, however what I have is a website where
users can upload multiple pictures.

I want to display these pictures in a table, that has 3 columns in each row,
and for instance if a user has 3 pictures, one row of three pictures will
display, or if they have 5 pictures, 2 rows, the first with 3 pics and the
second with 2 pics will be rendered.

How can I do something like this?

Thanks for the help in advance,
tperri

Nov 19 '05 #3

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

Similar topics

4
by: Gregory | last post by:
Hello, I've managed to build two web pages, one that can display images with associated text data in a table, and one that can resize and display images without the text. I'd like to resize the...
14
by: Akbar | last post by:
Hey there, Big-time curiosity issue here... Here's the test code (it's not that long)... it's to display a large number of image links with captions, ideally pulled in from an external file...
11
by: Ian Davies | last post by:
Hello Im having problems displaying my images as thumbnails in a table. My code for producing the new width and height from the original image is as follows...
2
by: Ken Varn | last post by:
I have a control that I developed that uses a custom HTTPModule to dynamically render images to a web page using ASP.NET. It works most of the time with one exception. For some reason, Internet...
0
by: Carl Gilbert | last post by:
Hi I am working on a site using ASP.NET, VB.NET and SQL Server. I have a page that displays images, and I want to display additional links to other images within the same category. When the...
3
by: CLEAR-RCIC | last post by:
I have several images i want to display in an ASP.Net application. The images are being passed to me in binary format from another application. Is there a good way to write them directly to an...
1
by: David Lozzi | last post by:
Hello, I'm wondering whats the best method to use for displaying several photos' thumbnails. One method I know is to dynamically resize the photo at the time the page is loaded. What does this...
7
by: Dave | last post by:
Hello All, These one may be a bit tricky, and what I'd like to do may not even be possible. I would love to hear any ideas you guys have for solving this. Here is the situation: I have a form...
13
by: Effix | last post by:
Hi everybody I have yet another problem, actually two but lets start with this one :-) Im making a very simple gallery or at least I think its simple. I have already made a upload script that...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.