Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have a List I am binding to a repeater like this:

MIDL
MessagesList =  GetMessages(this, new MessagesEventArguments(_userID, 0));
InboxRepeater.DataSource = MessagesList;
InboxRepeater.DataBind();


It basically looks like an Outlook inbox.

MSIL
FROM | SUBJECT |    DATE
JDoe    Hey       2.2.2011



My issue is that need to add nested rows to this repeater.

In my MessagesList their is an ID field that it brings back. So it would something like:

messageId = 1 | EncId = 1
messageId = 2 | EncId = 1
messageId = 3 | EncId = 1
messageId = 4 | EncId = 2
messageId = 5 | EncId = 3

For all messages with an EncId, if the EncId's are the same (like all EncId's that equal 1), I need to group them together in a new nested repeater. For each other unique EncId I need to create a new nested repeater so the output would look like something below.

MSIL
FROM | SUBJECT |    DATE
JDoe    Hey       2.2.2011
Steve   Meeting   2.4.2011
George --> This would be a new repeater a this line would be the header row
        "This would be the subject for messageId = 1 | EncId = 1"     2.5.2011
        "This would be the subject for messageId = 2 | EncId = 1"    2.5.2011
        "This would be the subject for messageId = 3 | EncId = 1"    2.5.2011
Rick    Hey2       2.2.2011
John    Maintenence  2.4.2011
Alex --> This would be a new repeater a this line would be the header row
        "This would be the subject for messageId = 4 | EncId = 2"     2.5.2011
Bill   Test Subject 2.6.2011
Harris   Test   3.9.2010
Alex --> This would be a new repeater a this line would be the header row
         This would be the subject for messageId = 5 | EncId = 3     2.5.2011


Can somebody help me with how I can do this???
Posted

Hi basically, you need to nest another repeater in the item template.
then you add a OnItemDataBound event to the outside repeater, and bind your data to the nested repeater.
heres a good article with examples
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900