473,789 Members | 2,634 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datagrid/Datalist - Multiple Rows as one questions.

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.
Nov 18 '05 #1
1 2131
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.


Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2593
by: Soul | last post by:
*** I am not sure this question belong to *.languages.csharp or *.framework.windowsdorms.databinding, so I post to both *** Hi, Currently I have a DataGrid which bind to a DataSet. One of the column in the DataSet table consist of DateTime value. I also have two DateTimePicker (startDate and endDate) on my Windows form.
1
5291
by: Craig Banks | last post by:
If a row of data in a dataset has a lot of columns the row displaying the data in a datagrid will run way off the screen. What I'd like to do is display a row of data over several datagrid rows so the user doesn't have to scroll horizontally. Essentially, I want to wrap a datagrid row (not text in individual columns) with as much control as possible. Make sense? While this seems simple enough on the surface, I can't figure out how to do...
2
7064
by: Simon Harris | last post by:
Hi All, I have an app which requires a list of coutries to be displayed, so far I have a datagrid which contains displays the countries Ok, along with flag images, these are also links to my dtail page - So far so good (Thanks to Pete Beech for the assistance in getting this far!) What I would now like is to spread the countries across multiple columns - e.g. grid/table with 20 countries, 5 rows X 5 columns. (Currently they are...
9
5067
by: tshad | last post by:
How do I find (and set) a couple of labels in the Footer after a DataGrid is filled? I have a bunch of DataGrids that get displayed nested inside a DataList. The datagrid looks like: ******************************************************************************* <asp:DataGrid visible="False" border=1
1
3448
by: sri_san | last post by:
Hello, I have a datagrid in which the header needs to span over 2 columns. I have tried creating a tableCells and tableRow at runtime and set the columnspan property of a cell to 2. But, the heading does not look good and is not aligned to the datagrid columns. Is there another way to do it? Any help would be great!! Thanks, Sam.
0
1699
by: bryanp10 | last post by:
I have a DataList on my page which contains multiple DropDownLists. My page defaults to showing six rows in the DataList. I want the ability to dynamically add rows if needed. Right now I'm just using an empty table with X rows, and adding a new row to the table that the DataList is bound to. However, I can't figure out a way to do this and at the same time maintain the current viewstate of the existing controls. When I call...
0
2081
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the end of this message, but I will start with an overview of the problem. I've made a content management solution for my work with a decently structured relational database system. The CMS stores articles. The CMS also stores related items --...
1
1888
by: Brock | last post by:
First note that I am using Framework 1.1. I have an .aspx page that is displaying a list of employees, but only the Employee Number, First Name, Last Name, and Title. It is working great. I recessed it in a <Div></Divto allow scrolling of just the data, not the page. What I need to do is place a DataList (also in a <Div></Divto allow scrolling of just the data) to the right of the Datagrid to show 40 Employee Detail fields (listed top to...
1
1921
by: Brock | last post by:
Thanks in advance... (you can see a screenshot of what my form looks like currently at http://www.juggernautical.com/DataGrid.jpg - the Datalist is super-imposed in 'design view' but the DataGrid is the actual running of the page) I've almost got this working (?) but need a little help. I have an .aspx page that has a DataGrid listing employees with a "Select" button that is to be used to populate the DataList to the right of the DataGrid...
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10404
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10195
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9016
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6765
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5415
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4090
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.