What is everyone using when you want to return a grid of results like you'd do with the GridView control on the server-side? Currently I'm just using the ListView control but it doesn't seem right. Unfortunately I'm drawing out a table for each row since
I can't seem to add the ItemTemplateControlID to a <tr> tag (doing that displays nothing for some reason). So, while I have it working OK I'd love to hear the "correct" way to emulate a GridView using Atlas controls.
As far as I know, this should work. The reason why it doesn't work when you have a table with a tr, is (afaik) related to the IE's DOM representation for it, which adds the tbody implicitly if you didn't define it.
That did it...thanks for the suggestion. By adding the <tbody> tag and putting the ItemTemplateControlID value on the <tr> tag it takes it. Much nicer. :-)
dwahlin
Participant
1499 Points
18 Posts
ASPInsiders
MVP
Emulating a GridView with Atlas
Oct 04, 2005 11:23 PM|LINK
Thanks,
Dan
<
atlas:ListView id="searchResults" runat="server" ItemTemplateControlID="row" CssClass="listView" ItemCssClass="item" AlternatingItemCssClass="alternatingItem"><LayoutTemplate> <table id="row" runat="Server" width="100%" border="0"> <tr> <td width="25%"> <atlas:Label id="Label3" runat="server"> <Bindings> <atlas:Binding DataPath="CustomerID" Property="text" /> </Bindings> </atlas:Label> </td> <td width="25%"> <atlas:Label id="name" runat="server"> <Bindings> <atlas:Binding DataPath="ContactName" Property="text" /> </Bindings> </atlas:Label> </td> <td width="25%"> <atlas:Label id="Label2" runat="server"> <Bindings> <atlas:Binding DataPath="CompanyName" Property="text" /> </Bindings> </atlas:Label> </td> <td width="25%"> <atlas:Label id="Label1" runat="server"> <Bindings> <atlas:Binding DataPath="Country" Property="text" /> </Bindings> </atlas:Label> </td> </tr> </table> </LayoutTemplate> </atlas:ListView>
WilcoB
Participant
1454 Points
290 Posts
Re: Emulating a GridView with Atlas
Oct 05, 2005 08:05 AM|LINK
<table>
<tbody id="rowContainer" runat="server">
<tr id="rowTemplate" runat="server">....</tr>
</tbody>
</table>
As far as I know, this should work. The reason why it doesn't work when you have a table with a tr, is (afaik) related to the IE's DOM representation for it, which adds the tbody implicitly if you didn't define it.
dwahlin
Participant
1499 Points
18 Posts
ASPInsiders
MVP
Re: Emulating a GridView with Atlas
Oct 05, 2005 07:25 PM|LINK