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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weight loss for the Grid DTC

Status
Not open for further replies.

david7777777777

Programmer
Sep 26, 2001
417
US
I've got about 17 fields from a table/recordset I'm displaying, currently using the GRID DTC. The Grid is just too darn wide, even after playing with its formatting properties!!! Is there a way to do something like this instead of using the grid:

Arrange a set of textboxes (or some DTC) neatly in a group (in a table, even) in a nice, small area of the page and have the recordset toss its results into this group of texboxes, duplicating/cloning the entire group of textboxes down the page for each record that needs to be displayed.

Thanks
 
You could make a simple loop between body tags in the place, where you want your table to be:

<body>
...
<% rsMydata.movefirst
Do While NOT rsMydata.EOF %>
<table>
<tr>
<td>header1/header9</td>
<td>header2/header10</td>
<td>header3/header11</td>
//and so on
</tr>
<tr>
<td>rsMydata(&quot;field1&quot;)</td>
<td>rsMydata(&quot;field2&quot;)</td>
<td>rsMydata(&quot;field3&quot;)</td>
</tr>
//Now make another table row for the data
<tr>
<td>rsMydata(&quot;field9&quot;)</td>
<td>rsMydata(&quot;field10&quot;)</td>
<td>rsMydata(&quot;field11&quot;)</td>
</tr>
</table>
<% rsMyData.movenext
Loop%>
...
</body>

There are probably other things you can do as well.
&quot;Defeat is not the worst of failures. Not to have tried is the true failure.&quot;
-George E. Woodberry
 
Thanks, that seems to be working, kind of. the only problem is that I'm apparently not typing the correct code to display the field values. In the cells where I want the data to be displayed, I've got:

<td>rsTapes(&quot;Origin&quot;)</td>

Where rsTapes is my recordset and &quot;Origin&quot; is the name of one of the fields I want to display in the table. So right now it's displaying multiple rows (good!) but it's litterally displaying rsTapes(&quot;Origin&quot;) in each cell instead of the actual value of that field. any ideas? Thanks.
 
Never mind, I figured it out. I just placed hidden textbox DTC's in the cells and tied them to the recordset. Thanks again.
 

Hi,

I'm sorry. I was in a hurry. Because your recordset is server side you have to refrence it in table like this:

<td><%=rsMydata(&quot;field9&quot;)%></td>

You won't need DTC's this way.
&quot;Defeat is not the worst of failures. Not to have tried is the true failure.&quot;
-George E. Woodberry
 
There is no difference to writing a grid in code (as above) and using the grid DTC. The browser gets the same table HTML. The only way to force a table to have a particular layout is to use images (invisible gif, typically) in the top table cells.
Click the 'fixed column widths' tickbox on the format panel of the Grid DTC. This tells it to add the 'width=' tag to every cell, or not. Without the 'width=' info, the grid expands to prevent wordwrap (but anything is still posible!).

Try using a stylesheet to set the TD style - so it has a smaller font size. (Content Management)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top