473,385 Members | 1,185 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,385 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 1475
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...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.