473,320 Members | 1,896 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.

How to make datagrid w/ 2 addresses in each row

I have a page listing all the addresses for a customer and I want 2
addresses per row. Each address is in a template column so I can add
special formatting and buttons. My problem is that each address is a row of
data made of up many fields (line1, line2, city, state, etc.). So I can
populate the first address in the row's left template, but how do I then go
to the next row of data for the 2nd address while remaining in the 1st row
in the datagrid to populate the right template? And then continue on like
this in the next datagrid row? I know I could write a special stored
procedure that would put 2 addresses on each row of data and call all of the
fields something like this: 1line1, 1line2, 1city, 1state, 2line1, 2line2,
2city, 2state, etc. But to do this I need to create a #temp table in the
stored procedure and use a curser to loop through the data adding 2
addresses to each row of the temp table. This is not a scaleable way of
retrieving data from the server. Surely this must be a common problem with
a more elegant solution?

Any great ideas out there?

--
mo*******@nospam.com
Nov 18 '05 #1
3 1473
Can you use a datalist? You can specify horizontal direction and set the number of columns to "snake" however you want, and you can do whatever you need with the templates, buttons, etc

----- moondaddy wrote: ----

I have a page listing all the addresses for a customer and I want
addresses per row. Each address is in a template column so I can ad
special formatting and buttons. My problem is that each address is a row o
data made of up many fields (line1, line2, city, state, etc.). So I ca
populate the first address in the row's left template, but how do I then g
to the next row of data for the 2nd address while remaining in the 1st ro
in the datagrid to populate the right template? And then continue on lik
this in the next datagrid row? I know I could write a special store
procedure that would put 2 addresses on each row of data and call all of th
fields something like this: 1line1, 1line2, 1city, 1state, 2line1, 2line2
2city, 2state, etc. But to do this I need to create a #temp table in th
stored procedure and use a curser to loop through the data adding
addresses to each row of the temp table. This is not a scaleable way o
retrieving data from the server. Surely this must be a common problem wit
a more elegant solution

Any great ideas out there

--
mo*******@nospam.co

Nov 18 '05 #2
Thanks I'll try it. Never did a datalist before and didn't know that.

--
mo*******@nospam.com
"Bill Borg" <an*******@discussions.microsoft.com> wrote in message
news:B2**********************************@microsof t.com...
Can you use a datalist? You can specify horizontal direction and set the number of columns to "snake" however you want, and you can do whatever you
need with the templates, buttons, etc.
----- moondaddy wrote: -----

I have a page listing all the addresses for a customer and I want 2
addresses per row. Each address is in a template column so I can add
special formatting and buttons. My problem is that each address is a row of data made of up many fields (line1, line2, city, state, etc.). So I can populate the first address in the row's left template, but how do I then go to the next row of data for the 2nd address while remaining in the 1st row in the datagrid to populate the right template? And then continue on like this in the next datagrid row? I know I could write a special stored
procedure that would put 2 addresses on each row of data and call all of the fields something like this: 1line1, 1line2, 1city, 1state, 2line1, 2line2, 2city, 2state, etc. But to do this I need to create a #temp table in the stored procedure and use a curser to loop through the data adding 2
addresses to each row of the temp table. This is not a scaleable way of retrieving data from the server. Surely this must be a common problem with a more elegant solution?

Any great ideas out there?

--
mo*******@nospam.com

Nov 18 '05 #3
Hi Moondaddy,

Both DataList and Repeater control are suitable for your situation. And in
addition to their customizability , there is also performance concerns
between the Three ASP.NET buildin databind controls. Here are some
reference in MSDN:

#Deciding When to Use the DataGrid, DataList or Repeater
http://msdn.microsoft.com/library/en...nusedatawebcon
trols.asp?frame=true

#Repeater Web Server Control
http://msdn.microsoft.com/library/en...erWebControl.a
sp?frame=true

#DataList Web Server Control
http://msdn.microsoft.com/library/en...stWebControl.a
sp?frame=true

Hope also helpful. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #4

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

Similar topics

3
by: Stephen | last post by:
I've got a datagrid with a remove button and I would like to add some code in the code behind page so as whenthe button is clicked the corresponding row in the datagrid is removed. The Datagrid is...
4
by: Stephen | last post by:
I have got an event below to remove items from an arraylist and then to rebind the arraylist to the datagrid subsequently deleting the appropriate row. My problem is that my code makes sense and I...
1
by: Stephen | last post by:
I have a really annoying problem with a datagrid. I have an application which populates a datagrid on the onclick event of a button. The datagrid is bound to an ArrayList which holds the values. ...
0
by: Stephen | last post by:
I have a datagrid with a remove button and I would like to add some code in the code behind page so as whenthe button is clicked the corresponding row in the datagrid is removed. The Datagrid is...
2
by: Stephen | last post by:
I am trying to delete a row in a datagrid on the onclick of a asp:ButtonColumn. The datagrid is created from the items in an arraylist so what im trying to do is remove the item from the array and...
4
by: Stephen | last post by:
I've got a really annoying problem with a datagrid. I have an application which populates a datagrid on the onclick event of a button. The datagrid is bound to an ArrayList which holds the values. ...
2
by: moondaddy | last post by:
I have a page listing all the addresses for a customer and I want 2 addresses per row. Each address is in a template column so I can add special formatting and buttons. My problem is that each...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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.