473,403 Members | 2,323 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,403 software developers and data experts.

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 1437
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.microsoft.com> wrote in message
news:10**********************************@microsof t.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.microsoft.com> wrote in message
news:3A**********************************@microsof t.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.microsoft.com> wrote in message news:10**********************************@microsof t.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.microsoft.com> wrote in message
news:3A**********************************@microsof t.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.microsoft.com> wrote in message news:10**********************************@microsof t.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********@mecrossroad.bg> wrote in message news:ON**************@TK2MSFTNGP09.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.microsoft.com> wrote in message
news:3A**********************************@microsof t.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.microsoft.com> wrote in message news:10**********************************@microsof t.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.DataSource;
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.Count; 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.Add ( dr );
}

DataList.DataSource = dt_dest;

Hope This Helps
Regards
Martin

"David Lozzi" <dlozzi(remove-this)@delphi-ts.com> wrote in message
news:eG**************@TK2MSFTNGP12.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********@mecrossroad.bg> wrote in message
news:ON**************@TK2MSFTNGP09.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.microsoft.com> wrote in message news:3A**********************************@microsof t.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.microsoft.com> wrote in message news:10**********************************@microsof t.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
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...
3
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...
15
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" ...
2
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...
1
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...
6
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...
1
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...
1
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 ...
0
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...
3
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 = {...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
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,...
0
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...
0
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...
0
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...
0
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,...
0
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...

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.