| | |
Special formatting of a GridView...
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
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 advice ajax alltypeofvideos asp asp.net bc30451 bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn checkbox class click commonfunctions compatible confirmationcodegeneration content contenttype control countryselector courier css database datagrid datagridview datagridviewcheckbox datalist deadlock deployment development dgv dropdownlist dropdownmenu dynamic edit embeddingactivexcontrol expose findcontrol flash flv formatdecimal forms formview gridview homeedition iframe iis javascript jquery list login menu microsoft mono mssql multistepregistration nameisnotdeclared numerical objects order panelmasterpagebuttoncontrols problem ratings rotatepage save schoolproject search security serializesmo.table silverlight smartcard sql sqlserver2005 ssl suse textbox tracking unauthorized validation vb.net video virtualdirectory vista visual-studio visualstudio vs2008 web webarchitecture webdevelopemnt webdevelopment webservice wizard xml youareanotmemberofthedebuggerusers





