Solved

Repeater Group By

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

759 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

21 Experts available now in Live!

Get 1:1 Help Now