actually I am using a repeater control for showing some reports.
<asp:Repeater id="cdcatalog" runat="server">
<HeaderTemplate>
<table border="1" width="500">
<tr>
<th>Cost Code</th>
<th>Total</th>
<th>Price</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><%#Eval("Cost_Code")%> </td>
<td><%#Eval("Total")%> </td>
<td><%#Eval("Price")%> </td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
below is my sql query
ALTER Proc [dbo].[RP_ByCost_Code]
@Date1 datetime,
@Date2 datetime
as
select Cost_Code , Total , (Total*12) as Price from mtblLog_Book where Vehicle_Booking_Date between @Date1 and @Date2 order BY Cost_Code
and the report comes like below format

see there are repeated items is coming. Let take ENE-Direct I want to take it just once for every ENE-Direct row and it should show once for all Cost Codes
You can use a nested
Repeateralong with the LINQGroupBymethod to achieve this.I am not sure of your DataSource and how you are binding the
cdcatalogrepeater, so in this example I am using a List ofCatalogItems. This is theCatalogItemclass:You will need a page-level List:
Basically, you will bind the outside repeater to a list that is grouped by
Cost_Code. The inner repeater will then be bound to a filtered list ofCatalogItems. Like so:The ascx code will look like this:
The final output will look like this: