473,698 Members | 2,411 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

format data in grid

I'm pulling data out of an oracle db and populating a datagrid such as this

cars doors Cylinders
chevy 4 6
ford 2 8

how can i make it such as

cars chevy ford
cylinder 6 8
doors 4 2

if i can do this in either a datagrid or another way that would work
thx

Nov 18 '05 #1
5 1466
You have to use DataList control instead of DataGrid control
DataList control has a property RepeatDirection that will show your data in
the way you want by setting it to Horizontal

Regards
Martin

"IGotYourDotNet " <IG************ @discussions.mi crosoft.com> wrote in message
news:10******** *************** ***********@mic rosoft.com...
I'm pulling data out of an oracle db and populating a datagrid such as this
cars doors Cylinders
chevy 4 6
ford 2 8

how can i make it such as

cars chevy ford
cylinder 6 8
doors 4 2

if i can do this in either a datagrid or another way that would work
thx

Nov 18 '05 #2
Hey,

if you find a solution, please make sure it is posted here, I am looking for
the exact same thing!

thanks,

--
David Lozzi
Web Applications/Network Specialist
Delphi Technology Solutions, Inc.
dlozzi(remove-this)@delphi-ts.com
"IGotYourDotNet " <IG************ @discussions.mi crosoft.com> wrote in message
news:3A******** *************** ***********@mic rosoft.com...
i tried that and it still only displays as
cars doors Cylinders
chevy 4 6
ford 2 8

i found an article once on how to change the header of the grid from the top to the side but i can't find it again. If i could find that that would work on what i need
"Martin Marinov" wrote:
You have to use DataList control instead of DataGrid control
DataList control has a property RepeatDirection that will show your data in the way you want by setting it to Horizontal

Regards
Martin

"IGotYourDotNet " <IG************ @discussions.mi crosoft.com> wrote in message news:10******** *************** ***********@mic rosoft.com...
I'm pulling data out of an oracle db and populating a datagrid such as

this

cars doors Cylinders
chevy 4 6
ford 2 8

how can i make it such as

cars chevy ford
cylinder 6 8
doors 4 2

if i can do this in either a datagrid or another way that would work
thx


Nov 18 '05 #3
It must do that. Take a look at the microsoft article :
http://msdn.microsoft.com/library/de...ctiontopic.asp

Regards
Martin

"IGotYourDotNet " <IG************ @discussions.mi crosoft.com> wrote in message
news:3A******** *************** ***********@mic rosoft.com...
i tried that and it still only displays as
cars doors Cylinders
chevy 4 6
ford 2 8

i found an article once on how to change the header of the grid from the top to the side but i can't find it again. If i could find that that would work on what i need
"Martin Marinov" wrote:
You have to use DataList control instead of DataGrid control
DataList control has a property RepeatDirection that will show your data in the way you want by setting it to Horizontal

Regards
Martin

"IGotYourDotNet " <IG************ @discussions.mi crosoft.com> wrote in message news:10******** *************** ***********@mic rosoft.com...
I'm pulling data out of an oracle db and populating a datagrid such as

this

cars doors Cylinders
chevy 4 6
ford 2 8

how can i make it such as

cars chevy ford
cylinder 6 8
doors 4 2

if i can do this in either a datagrid or another way that would work
thx


Nov 18 '05 #4
I don't think this is what we're looking for, or is it.... Lemme see if I can clear this up a little. This is how a DataGrid displays a table's data now:

ID UserName Password Security
1 David dave 10 Edit
2 John doe 10 Edit
3 Mary smith 5 Edit

Correct me if i'm wrong, but we are looking for the datagrid to do the following:

ID 1 2 3
Username David John Mary
Password dave doe smith
Security 10 10 5
Edit Edit Edit
Actually, its like a Pivot table? Maybe have a stored procedure handle the returning values as a pivot table? Would it still be editable?

THANKS!
--
David Lozzi
Web Applications/Network Specialist
Delphi Technology Solutions, Inc.
dlozzi(remove-this)@delphi-ts.com
"Martin Marinov" <me********@mec rossroad.bg> wrote in message news:ON******** ******@TK2MSFTN GP09.phx.gbl...
It must do that. Take a look at the microsoft article :
http://msdn.microsoft.com/library/de...ctiontopic.asp

Regards
Martin

"IGotYourDotNet " <IG************ @discussions.mi crosoft.com> wrote in message
news:3A******** *************** ***********@mic rosoft.com...
i tried that and it still only displays as
cars doors Cylinders
chevy 4 6
ford 2 8

i found an article once on how to change the header of the grid from the

top
to the side but i can't find it again. If i could find that that would

work
on what i need
"Martin Marinov" wrote:
You have to use DataList control instead of DataGrid control
DataList control has a property RepeatDirection that will show your data in the way you want by setting it to Horizontal

Regards
Martin

"IGotYourDotNet " <IG************ @discussions.mi crosoft.com> wrote in message news:10******** *************** ***********@mic rosoft.com...
> I'm pulling data out of an oracle db and populating a datagrid such as
this
>
> cars doors Cylinders
> chevy 4 6
> ford 2 8
>
> how can i make it such as
>
> cars chevy ford
> cylinder 6 8
> doors 4 2
>
> if i can do this in either a datagrid or another way that would work
> thx
>


Nov 18 '05 #5
ok, i've got your point and found a previous code that i wrote for inverting
rows and columns

DataTable dt = (DataTable) dataGrid1.DataS ource;
DataTable dt_dest = new DataTable();

dt_dest.Columns .Add ( dt.Columns[0].ColumnName );
for ( int i=0; i < dt.Rows.Count; i++ )
{
dt_dest.Columns .Add ( dt.Rows[i][0].ToString() );
}

for ( int i=1; i < dt.Columns.Coun t; i++ )
{
DataRow dr = dt_dest.NewRow( );
dr[0] = dt.Columns[i].ColumnName;
for ( int r=0; r < dt.Rows.Count; r++ )
{
dr[r+1] = dt.Rows[r][i];
}
dt_dest.Rows.Ad d ( dr );
}

DataList.DataSo urce = dt_dest;

Hope This Helps
Regards
Martin

"David Lozzi" <dlozzi(remov e-this)@delphi-ts.com> wrote in message
news:eG******** ******@TK2MSFTN GP12.phx.gbl...
I don't think this is what we're looking for, or is it.... Lemme see if I
can clear this up a little. This is how a DataGrid displays a table's data
now:

ID UserName Password Security
1 David dave 10 Edit
2 John doe 10 Edit
3 Mary smith 5 Edit

Correct me if i'm wrong, but we are looking for the datagrid to do the
following:

ID 1 2 3
Username David John Mary
Password dave doe smith
Security 10 10 5
Edit Edit Edit
Actually, its like a Pivot table? Maybe have a stored procedure handle the
returning values as a pivot table? Would it still be editable?

THANKS!
--
David Lozzi
Web Applications/Network Specialist
Delphi Technology Solutions, Inc.
dlozzi(remove-this)@delphi-ts.com
"Martin Marinov" <me********@mec rossroad.bg> wrote in message
news:ON******** ******@TK2MSFTN GP09.phx.gbl...
It must do that. Take a look at the microsoft article :
http://msdn.microsoft.com/library/de...ctiontopic.asp
Regards
Martin

"IGotYourDotNet " <IG************ @discussions.mi crosoft.com> wrote in message news:3A******** *************** ***********@mic rosoft.com...
i tried that and it still only displays as
cars doors Cylinders
chevy 4 6
ford 2 8

i found an article once on how to change the header of the grid from the top
to the side but i can't find it again. If i could find that that would

work
on what i need
"Martin Marinov" wrote:
You have to use DataList control instead of DataGrid control
DataList control has a property RepeatDirection that will show your data in
the way you want by setting it to Horizontal

Regards
Martin

"IGotYourDotNet " <IG************ @discussions.mi crosoft.com> wrote in message news:10******** *************** ***********@mic rosoft.com...
> I'm pulling data out of an oracle db and populating a datagrid such

as this
>
> cars doors Cylinders
> chevy 4 6
> ford 2 8
>
> how can i make it such as
>
> cars chevy ford
> cylinder 6 8
> doors 4 2
>
> if i can do this in either a datagrid or another way that would work
> thx
>


Nov 18 '05 #6

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

Similar topics

13
3603
by: Aladdin | last post by:
I have an MS Access form on which I have a listbox listing tables in that database. I want to be able to click on any of those tables and view its contents on the same form using subforms or any grid control. I tried many grid controls (DBGrid, DataGrid, MSFlexGrid), the ADO Data Control and everything I can think of, with no success. Here are the contraints I faced: (1) Populating any of the grid controls manually is too slow for my...
3
2423
by: Peter | last post by:
I have a datagrid on WinForm and I am trying to format the Grid. I am using the following code, the code runs fine, but nothing happens after it runs, the datagrid does not change (with data in the grid or with out any data) DataGridTableStyle gridStyle = new DataGridTableStyle(); gridStyle.MappingName = "Test"; DataGrid1.TableStyles.Add(gridStyle); gridStyle.GridColumnStyles.Width = 100; gridStyle.GridColumnStyles.HeaderText="Test...
15
14278
by: Fritz Switzer | last post by:
I'd like to have a string assigned the value of a DateTime.AddMinutes(amount) so that the string is formatted in "HH:MM" format. For example: DateTime.Now.AddMinutes(30) returns "00:30" DateTime.Now.AddMinutes(90) returns "1:30" or "01:30"
2
3031
by: Peter | last post by:
Does anyone have an example of how to format VS 2003 Data Grid that looks like the example below? I want the data to be grouped by the Date Field and display one date for each group of dates and the date to be the heading for each group. ------------------------------------------------------ | | Consignee | Location | MU | ------------------------------------------------------ | February 21, 2005 ...
1
1378
by: Peter | last post by:
Does anyone have an example of how to format VS 2003 Data Grid that looks like the example below? I want the data to be grouped by the Date Field and display one date for each group of dates and the date to be the heading for each group. ------------------------------------------------------ | | Consignee | Location | MU | ------------------------------------------------------ | February 21, 2005 ...
6
3836
by: Hutty | last post by:
I've looked around and have yet to find anything that would answer my question regarding formating a column in a datagrid. My grid looks like this as far as data" AMHQCON|51300.01|-3147 The first two columns are pretty much text column, but subsequent columns 1-12 are numerical. I'm trying to get the thousand separator to work. Any ideas?
1
1691
by: Paul | last post by:
Hi just wondering how to limit the string size for a data grid column, can this be done from the properties box, data formatting expression? If so what would be the expression to limit it to 20 characters? thanks. -- Paul G Software engineer.
1
1520
by: Parveen | last post by:
This is a pretty simple issue to solve...but i can't seem to figure it out!! I want data in some columns to show as currency so I set the format of a column to currency through code by myGrid.cols(ColIndex).format = "c Then I manually add rows to the grid...but when I look at the currency column, I see that the data is not formatted - it still shows up as a numeric value without the "$" sign
0
903
by: pnarasimha | last post by:
Hai Friends , I have strucked with one problem in my Project , that is actually in my Project i had Grid control and User may Copy excel data from Excel file rows and paste into in that Grid Control so for that iam able Getting that Data Based on "Commaseparated"and "Tex" and As well "Stringformat" so here im using "Commaseperated" and iam putting that Data into "Streamreader" and splitting that based on the Commaseperated...
3
1311
by: harry.viet | last post by:
I use the prototype library and create a class that builds a grid using some parameters as mentioned below. Everything is working but only the parameters for Number formatting var gridopts = { iPageSize : 100, dataSource : '../data/ledgergetdata.asp', dataPars : { acct_type : '2' }, columns : }, { name: 'credit', field : 'credit', width: '10%' ,
0
8675
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9029
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...
1
8897
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8862
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7729
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
6521
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
4370
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...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2331
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.