| | |
Special formatting of a GridView...
Please support our ASP.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Jun 2006
Posts: 3
Reputation:
Solved Threads: 0
SELECT Stores.strStoreName,
(CASE WHEN T.intItemID=S.MinSub THEN Stores.strLogo ELSE NULL END) AS displayCategory,
T.txtDescription
FROM Items AS T
INNER JOIN
Stores ON T.intStoreID = Stores.intStoreID,
( SELECT intStoreID , Min(intItemID ) AS MinSub
FROM Items
GROUP BY intStoreID ) AS S
WHERE T.intStoreID = S.intStoreID
ORDER BY T.intStoreID, T.intItemID
The SQL works, but I need to do some formatting within the datagrid but I am unsure of the best way...
<asp:GridView Width="100%" BorderWidth="0" CellPadding="0" CellSpacing="0" BorderColor="white"
AutoGenerateColumns="FALSE" ShowHeader="false" ID="gvStores" runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<table>
<tr>
<td valign=top width="110px">
<img border="0" src="images/<%# Eval("strLogo")%>" />
</td>
<td valign=top class="bluebodytext">
<%# Eval("txtDescription")%>
<i>Offer Expires <%# String.Format("{0:d}",Eval("dtmExpiration")) %></i>
</td>
</tr>
</table>
<div class="row">
</div>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
It display data like this
StoreImage 1 Item 1
Item 2
Item 3
StoreImage 2 Item 1
Item 3
What I need to do is insert an HR AFTER the StoreImage(n) like this
StoreImage 1 Item 1
Item 2
Item 3
_______________________
StoreImage 2 Item 1
Item 3
Is there any simple way I could accomplish this??
Thanks
(CASE WHEN T.intItemID=S.MinSub THEN Stores.strLogo ELSE NULL END) AS displayCategory,
T.txtDescription
FROM Items AS T
INNER JOIN
Stores ON T.intStoreID = Stores.intStoreID,
( SELECT intStoreID , Min(intItemID ) AS MinSub
FROM Items
GROUP BY intStoreID ) AS S
WHERE T.intStoreID = S.intStoreID
ORDER BY T.intStoreID, T.intItemID
The SQL works, but I need to do some formatting within the datagrid but I am unsure of the best way...
<asp:GridView Width="100%" BorderWidth="0" CellPadding="0" CellSpacing="0" BorderColor="white"
AutoGenerateColumns="FALSE" ShowHeader="false" ID="gvStores" runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<table>
<tr>
<td valign=top width="110px">
<img border="0" src="images/<%# Eval("strLogo")%>" />
</td>
<td valign=top class="bluebodytext">
<%# Eval("txtDescription")%>
<i>Offer Expires <%# String.Format("{0:d}",Eval("dtmExpiration")) %></i>
</td>
</tr>
</table>
<div class="row">
</div>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
It display data like this
StoreImage 1 Item 1
Item 2
Item 3
StoreImage 2 Item 1
Item 3
What I need to do is insert an HR AFTER the StoreImage(n) like this
StoreImage 1 Item 1
Item 2
Item 3
_______________________
StoreImage 2 Item 1
Item 3
Is there any simple way I could accomplish this??
Thanks
![]() |
Similar Threads
- Set, View, Change, or Remove Special Permissions for Files and Folders in Windows XP (Windows tips 'n' tweaks)
- Adding color to GridView (ASP.NET)
- GUI colouring (C++)
- C# .NET Gridview (C#)
- formatting problems (Windows NT / 2000 / XP)
- Differences between formatting (Storage)
- Need Outlook 2003 addon: sort emails in special folders? (Windows NT / 2000 / XP)
Other Threads in the ASP.NET Forum
- Previous Thread: How to close window
- Next Thread: Please anybody help to create autocomplete dropdown box with editable in asp.net
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol ajax alltypeofvideos asp asp.net bc30451 beginner bottomasp.net browser businesslogiclayer c# c#gridviewcolumn cac checkbox class commonfunctions compatible confirmationcodegeneration content contenttype countryselector courier dataaccesslayer database datagrid datagridview datagridviewcheckbox datalist deployment development dgv dropdownlist dropdownmenu dynamic dynamically edit embeddingactivexcontrol fileuploader fill findcontrol flash flv formatdecimal forms formview gridview gudi homeedition iis javascript jquery listbox menu microsoft mouse mssql nameisnotdeclared news opera panelmasterpagebuttoncontrols problem redirect registration relationaldatabases reportemail schoolproject security serializesmo.table sessionvariables silverlight smartcard smoobjects software sql sql-server sqlserver2005 ssl textbox tracking treeview unauthorized validatedate validation vb.net video videos vista visual-studio visualstudio web webapplications webarchitecture webdevelopemnt webdevelopment webprogramming webservice youareanotmemberofthedebuggerusers





