How do I show a sectioned list?

C

Confused Newbie

I'm coming from ASP and learning ASP.NET with VWD Express. I have a page in
ASP that shows an employee list by sections in a table like this:

East Coast
Person 1 in this category | Office Location | Phone
Person 2

North Central
Person 1
Person 2

South Central
Person 1
Person 2

West Coast
Person 1
Person 2

National Accounts
Name
Name


In ASP, I have an ADO recordset that contains just the categories in the
order they should display (select region_id, region_name order by
region_display_order from sales_regions), and another with the names that is
sorted by region and name (select region_id, name_last, name_suffix_gen,
name_first, name_middle from sales_reps order by region_id, name_last,
name_suffix_gen, name_first, name_middle). I loop through the regions, set
the filter on the reps to the region, and response.write the names until I
hit the end. This has worked fine for ages. (If it matters, the database
is Access 2003, and must remain that as SQL2005 is completely out of the
question until our hosting contract runs out in June.)

How do I change this to take advantage of ASP.NET's features and get rid of
that clunky, ancient looping code? The list uses CSS styles for the section
name cells, as well as the names. The names also are hyperlinks that the
viewer can click on to send them an email. I am completely lost as to how
to use datalists or repeaters or whatever to make this work. Can someone
point me to an example of how to do this using VB (sorry, I can't cope with
also trying to figure out C# at the moment), or post a step-by-step
walkthrough? Thanks.
 
C

Confused Newbie

But how is this done for a variable number of groups/sections, which must
appear visually distinct like I showed in my example:

One Group
An Item
Another Item

Another Group
First Item
Second Item
Third Item

I can't hard code the groups, since I need to reuse the technique for other
pages as well. It must be driven by the number of records that appear in
that category's a "group" table, not set number of repetitions. It's like a
master-detail, but with everything already expanded when the page is
displayed and not requiring the user to click on anything to make it
visible. This is also read-only to the user. I see these on many sites, so
someone must be able to tell how to do it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,104
Latest member
LesliVqm09
Top