Solved

Repeater Group By

Posted on 2009-07-14
3
600 Views
Last Modified: 2012-10-15
I have a repeater that has the following data in it.

Group a, some data.....
Group a, some data.....
Group b, some data.....
Group b, some data.....
Group c, some data.....

I'd like it to print like...

Group a, some data.....
               some data.....
Group b, some data.....
               some data.....
Group c, some data.....

Any suggestions on how to go about this?  I'm coding in VB.
0
Comment
Question by:mmeisel
3 Comments
 
LVL 20

Expert Comment

by:informaniac
ID: 24849682
In case u r using oracle or sql server 2005...

http://www.experts-exchange.com/Database/Oracle/9.x/Q_22584378.html
0
 
LVL 15

Expert Comment

by:jinal
ID: 24849893
1.
If you bind DataTable to Repeater then better format DataTable such a way that it display look like group.

Original
Group A          10                20
Group A          10                30
Group B          20                10
Group B          20                40
Group B          20                10
After coversion
Group A          10                20
                        10                30
Group B         20                10
                        20                40
                        20                10
Means make first row appear for group and make another column blank.

2.
Following link may help you.
http://www.aspcode.net/ASPNET-grouping-repeater-control.aspx
http://www.codeproject.com/KB/custom-controls/GroupedRepeater.aspx
0
 
LVL 1

Accepted Solution

by:
mmeisel earned 0 total points
ID: 24850050
I handled this on ItemDataBound.
Protected Sub Repeater1_DataBound(ByVal sender As Object, ByVal e As RepeaterItemEventArgs)
        Dim item As RepeaterItem = e.Item
        If item.ItemType = ListItemType.AlternatingItem OrElse item.ItemType = ListItemType.Item Then
            If CType(item.FindControl("Label1"), Label).Text = Session("Variable") Then
                CType(item.FindControl("Label1"), Label).Visible = False
            End If
 
            Session("Variable") = CType(item.FindControl("Label1"), Label).Text
        End If
    End Sub

Open in new window

0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Calling web service and its methods dynamically 2 59
Name space syntax error 12 58
Why does my excel data start at B1 instead of A1. 9 84
Question about JQuery and asp.net 3 27
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question