473,379 Members | 1,330 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

VB-WEB: Adding Subheader to Repeater

I may be going at this completely wrong, but this is what I have come up with so far.

I am using a dataset and a repeater to present information. The sample dataset is:

Name, Title, Email, Place
tom, worker, tom@, area1
joe, worker, joe@, area1
bill, leader, bill@, area2
john, worker, john@, area2
steve, worker, steve@, area3
and so on.

I want to display Name, Title and Email in the header row. (Works fine)
I want to group the people by Place (not a problem)

I want the information to be displayed in a table in the following order.

HEADER ROW (got that)
area1 (Place)
(List name title and email) NEXT ROW
(List name title and email) UNTIL ALL area1 are finished THEN
area2 (Place)
(List name title and email) NEXT ROW
(List name title and email) UNTIL ALL area2 are finished THEN
area3 (Place)
(List name title and email) NEXT ROW
(List name title and email) UNTIL ALL area3 are finished AND SO ON

I currently am getting the following.
HEADER ROW (got that)
area1 (Place) NEXT ROW
(List name title and email) NEXT ROW
area1 (Place) NEXT ROW
(List name title and email) NEXT ROW
area2 (Place) NEXT ROW
(List name title and email) NEXT ROW
area2 (Place) NEXT ROW
(List name title and email) NEXT ROW
area3 (Place) NEXT ROW
(List name title and email) NEXT ROW AND SO ON

Is there any way to accomplish what I am trying to do using the repeater? I have read something about possibly putting a datagrid within the <ItemTemplate> tags but have no idea where to start on that one.

Thanks in advance.
Apr 24 '07 #1
3 1760
TRScheel
638 Expert 512MB
So basically you are trying to sort by Place? but you want sub headers?

so..

Header Info
Subheader (place)
-- information (name, email, etc)
Subheader 2
-- information

Am I right?
Apr 24 '07 #2
That is exactly right.
Apr 24 '07 #3
Alright, I finally got this figured out. I wanted to post the solution for those that might be curious.

I created the following function and then called it at the top of both the ItemTemplate and the AlternateTemplate (replace place with Office because of the exact field name)

Function checktempOffice(ByVal Office As String)
Dim tempstring As String = ""

If (tempOffice = Office) Then
'Do Nothign
Else
tempOffice = Office
tempstring = "<tr><td colspan=3><b>" & Office & "</b></td></tr>"

End If

Return tempstring

End Function

************************************************** **

Call was with:

<%#checktempOffice(DataBinder.Eval(Container.DataI tem, "Office").tostring)%>


This may or may not be the exact way to do it, but it is working properly.
Apr 24 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: Terry | last post by:
Hi, I need some feedback. We are converting to .Net and we are trying to decide on whether to use VB.net or C#.net. As far as our current systems, they will probably be rewritten in ASP.Net. I...
13
by: Arsalan | last post by:
Is there any advantage in C# over VB.NET ? Or the difference is only syntax ? Can anything done in C# which cannot be done in VB.NET?
28
by: Andy | last post by:
Any good resources regarding benefitis by using C3 over VB? /Andy
12
by: Leo Muller | last post by:
I always thought that moving from VB.NET to C# would be very easy. Even though so far it hasn't been hard, there are some annoying things, that may have to do with my visual studio settings. -...
16
by: Ben Hannon | last post by:
Hi, I'm writting a COM Class in VB.NET to be used in a VB6 project (Tired of the VB6 hassles with cloning and serializing an object). All my classes I need cloneable/serializable are now in a...
182
by: Jim Hubbard | last post by:
http://www.eweek.com/article2/0,1759,1774642,00.asp
25
by: Sharrukin Amiri | last post by:
Hello, I am using VB 6.0 for many years. Everytime I needed to build software applications, I just opened VB 6.0 and started coding. I am now looking VB.NET Express Edition and I find I can no...
2
by: D H | last post by:
Hi, Hi, I was looking for your opinion on VB.NET - its long-term prospects, etc. Sorry this is vague, but it's not meant to be a troll. It's a pro-VB.NET post actually. I haven't used VB or...
19
by: lonelyplanet | last post by:
Hi, I'm studying for 70-306 using the book "MCAD/MCSD Visual Basic .NET Windows Applications" published by McGraw Hill (ISBN: 0-07-212583-7). I found the book has no programming exercise...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.