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

Creating datagrid view from an two-dimensional array

Hello,

is there a way how to create data view (via datagrid) of a 2dim. array?
I've data which I've got via SOAP call - it is a customer list, I want to simply
display it in an datagrid. Can someone point me to an example how to do it?
thanx

Mirek
Nov 16 '05 #1
4 4828
mirek,

This isn't easy. While Array implements IList, the grid will reflect on
the properties of each value in the array, which in turn are another array
(which is a jagged array).

In order to get around this, you will want to create a class which
implements ICustomTypeDescriptor, or a class which has properties that map
to the horizontal dimension of your array. Then, create these classes, and
assign the values to each instance (each instance is a row). You will then
have an array of these, which you can pass to the data grid.

Your other option is to create a data set, and populate it manually, and
then bind to that.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"mirek" <mi***@auto.cz> wrote in message
news:OF**************@TK2MSFTNGP15.phx.gbl...
Hello,

is there a way how to create data view (via datagrid) of a 2dim. array?
I've data which I've got via SOAP call - it is a customer list, I want to
simply
display it in an datagrid. Can someone point me to an example how to do
it?
thanx

Mirek

Nov 16 '05 #2
Nicholas Paldino [.NET/C# MVP] wrote:
mirek,

This isn't easy. While Array implements IList, the grid will reflect on
the properties of each value in the array, which in turn are another array
(which is a jagged array).

In order to get around this, you will want to create a class which
implements ICustomTypeDescriptor, or a class which has properties that map
to the horizontal dimension of your array. Then, create these classes, and
assign the values to each instance (each instance is a row). You will then
have an array of these, which you can pass to the data grid.

Your other option is to create a data set, and populate it manually, and
then bind to that.

Hope this helps.

Ok, but can this be automated? When I'm accessing web service via SOAP, I can
make proxy using wsdl.exe - from wsdl documet, which describes also datastructures.
Isn't there a way how to use it?

TIA

mirek
Nov 16 '05 #3
mirek,

No, not really, because the structure of the data isn't such that it
binds to the grid easily. Either get the data into a data set, or you have
to create the intermediary class.

It's not really that hard, actually, to just stuff it into a data set.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"mirek" <mi***@auto.cz> wrote in message
news:uf**************@TK2MSFTNGP14.phx.gbl...
Nicholas Paldino [.NET/C# MVP] wrote:
mirek,

This isn't easy. While Array implements IList, the grid will reflect
on the properties of each value in the array, which in turn are another
array (which is a jagged array).

In order to get around this, you will want to create a class which
implements ICustomTypeDescriptor, or a class which has properties that
map to the horizontal dimension of your array. Then, create these
classes, and assign the values to each instance (each instance is a row).
You will then have an array of these, which you can pass to the data
grid.

Your other option is to create a data set, and populate it manually,
and then bind to that.

Hope this helps.

Ok, but can this be automated? When I'm accessing web service via SOAP, I
can
make proxy using wsdl.exe - from wsdl documet, which describes also
datastructures.
Isn't there a way how to use it?

TIA

mirek

Nov 16 '05 #4
Nicholas Paldino [.NET/C# MVP] napsal(a):
mirek,

No, not really, because the structure of the data isn't such that it
binds to the grid easily. Either get the data into a data set, or you have
to create the intermediary class.

It's not really that hard, actually, to just stuff it into a data set.

So thank you, very much, for informations. Now I have to go to study ;)
thanx

Mirek
Nov 16 '05 #5

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

Similar topics

1
by: tolisss | last post by:
Hi i have created a new database and a new linked server that points to an AccessDB using an ODBC DSN. Now inside that new sql db i have create i need to created a new view so i open EM went to...
5
by: ComputerStop | last post by:
I am attempting to print a datagridview. I have not found any method that works successfully. Has any one been successful with this?
2
by: Bob | last post by:
I looked at the sample in the msdn january 2005 - Introducing a new datagrid, but the project downloaded failed to open. Any one can point me to a bit of code on how to go and select an image...
0
by: Tony A. | last post by:
I'm using VB 2005 with MS Access for as the database. I have a table (tblItem) that has two columns, ItemNum (key field) and ItemDescription. I also have a second table (tblOrdersDetail), this...
1
by: apothecary | last post by:
Hello Newbie here. Is there a way of creating a VIEW...using a stored procedure. I am basically trying to create a view to return some data that I am getting using a stored procedure. I...
1
by: radhikabista | last post by:
hey friends , i m not being able to save the updates in datagrid view when i press buttonsave_ gridview i have a class customer with two methods one to get the dataset and other to update database:...
1
mafaisal
by: mafaisal | last post by:
Hello Experts I am Using vb.net 2005 Hw To Put DateTime Picker in Datagrid view I have to sea Datetime Picker in Specified Cilomn of Datagrid I try This But The Location Hw To Change to the...
1
by: sainiamit25 | last post by:
Hi, I want to create a materlised view log in my database A and materlised view in some other database B. I was successful in creating materlised view in database B (after creating a dblink with...
1
by: chandan | last post by:
Hi All! How to Export Datagrid view data to excel in ASP.net 3.5? Thanks, Chandan
0
by: dougancil | last post by:
I have two forms and I'm trying to pass a declared variable from form1 to form2 and then pass that variable in a sql query that I have in a dataset that is bound to my form. I know that my query...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
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...
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
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.