Solved

Repeater Group By

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

830 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