Solved

Repeater Group By

Posted on 2009-07-14
3
599 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

895 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now