There are quite a few ways to accomplish this. This is one potential
solution. First off, some observations and assumptions.
You are titling your result table with a string that is not included in
your schema. I assume this will be a label like "Plan " & x, which x is an
incrementing number. I also assume you are dealing with the same number of
plans for each provider, although this would become an issue later if the
providers offer differing numbers of plans.
I do not know if you need to select one plan per provider or one plan among
all providers.
So, one way to accomplish this is to have a repeater control loop through a
distinct list of provider IDs. I will assume this is in a table and
providerID is the primary key.
Within each Repeater item template, use a radio button list with horizontal
orientation to display the plas for the current provider ID. This can be
done by bringing in all the plans and using a dataview to filter the plans
by provider ID and bind to the list.
Here's some psudeoCode:
(dt=datatable, dac=Data access component [you do have a data access layer,
right?], rpt=repeater, rbl=radiobutton list, dv=dataview)
' Get providers
dtProviders=dac Provider.Getpro viders()
' get plans
dtPlans=dacPlan s.GetAllPlans()
' Bind Providers to Repeater
with rptProviders
.datasource=dtp roviders
.databind
end with
' in Handler for rptProviders.It emDataBound
' Get the radiobuttonlist in the repeater Item template
rblPlans=ctype( e.item.findcont rol("rblPlans") ,radiobuttonlis t)
' Filter the plans datatable by the current Provider ID
with dvPlans
.table=dtplans
.rowfilter="pro vider_id=" & _
ctype(e.item.da taitem,datarowv iew).item("ID")
end with
' bind the filtered list
with rblPlans
.datasource=dvP lans
.databind
end with
You will have to tweak some of the settings as you go, but I think this
will get you started in the right direction. If not, there's always the
crosstab technique. That can be done in a SQL Stored Procedure using
dynamic SQL.
Best of luck!
mi***********@c omcast.net (Mike) wrote in news:5967eef5.0 410131151.75a68 038
@posting.google .com:
Hi!
Been stuck on this one for a bit. Would really appreciate any help on
this one.
To start. I have a sql database table with the following data and
design (ex)
------------------------------------
provider_id | plan_id | plan cost
------------------------------------
1 US-1 20.00
1 US-2 30.00
1 US-3 40.00
2 UK-1 10.00
2 UK-2 20.00
2 UK-3 32.00
I need to display this in a way (DataGrid, DataList, etc...)
where I can view all provider items on the same, line and select a
plan
using a radiobuttonlist or similar.
I'm not sure if it is something I need to do in the database query or
something
at the application level.
It will need to look something like this:
------------------------------------------
provider_id | plan_1 | plan_2 | plan 3
------------------------------------------
1 20.00 30.00 40.00
2 10.00 20.00 32.00
I would like the to be able to select a dollar amount(by radiobutton
if possible) and have the plan_id as the value if possible.
Has anybody got something like this working.