PDA

View Full Version : Forcing new rows in a GridView


snow
06-28-2006, 05:00 PM
Hello all,

I have a problem when laying out my gridview. What I really need to do is force a new tr into the code that the datagrid is generating. So where it has:

<asp:gridview>
<columns>
<asp:boundfield>
<asp:boundfield>
<asp:boundfield>
</columns>
</asp:gridview>


I don't want the <td> to be generated, but a <tr><td> instead...
It would be so simple if I could slip some script inbetween them with the html being written, is this possible?

The generated table should look something like:

| BOUNDFIELD1 | BOUNDFIELD2 |
| BOUNDFIELD3 |
| BOUNDFIELD1 | BOUNDFIELD2 |
| BOUNDFIELD3 |
| BOUNDFIELD1 | BOUNDFIELD2 |
| BOUNDFIELD3 |

It sounded like such an easy thing to fix when I started, but I've been working on it for about 2 hours!

I would be truly grateful for any help!

Sarah Williamson

otaku149
06-28-2006, 05:41 PM
Instead of your gridview, use a repeater:

http://www.asp.net/QuickStart/aspnet/doc/ctrlref/data/repeater.aspx

snow
06-29-2006, 09:02 AM
Thanks, I was thinking about doing that previously, but hoping I didn't have to, as some of the Datagrid functions would come in handy, but I'll get right along with coding it if there's nothing else to be done!

Thanks very much!

Sarah Williamson