Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid: Multiple Rows Per Dataset Row 1

Status
Not open for further replies.

olypost

Programmer
Apr 15, 2005
43
US
If a row of data in a dataset has a lot of columns the row displaying the
data in a datagrid will run way off the screen. What I'd like to do is
display a row of data over two datagrid rows so the user doesn't have to
scroll horizontally. Essentially, I want to wrap a datagrid row (not text in
individual columns) with as much control as possible.

For example, 10 columns on the first row and then 3 columns on the second row for the same physical record in the dataset.

Is this possible? Or is a datalist the only straightforward way to do this?

Thanks
 
As I see it, there are 2 options.
1. Select fewer rows to display.

2. Create template columns in your datagrid. then you can place multiple controls(ex labels) in(for ex) the itemtemplate column. You can then space them how you like.

Jim
 
What I'd like to do is essentially stack a pair of columns one on top of another in a datagrid row. For example, home phone and business phone appearing as:

(800) 123-4567 col2 col3 col4 col5
(800) 123-9123

Is it possible to have the itemtemplate column have 2 controls positioned like this? Do I need to put a <BR> somewhere?

Thanks
 
Ex: Place a label control in the template, then press enter, then place the second label, and so on. You can modify the HTML yourself. Also, you can place a table in the column as well to positon the controls.

Jim
 
Yes you can have multiple columns in the itemtemplate and yes you put the <br> tag in between the fields if you want them on separate lines.

Hope everyone is having a great day!

Thanks - Jennifer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top