473,473 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

need grid-style control

I know there's a DataGridView, but I think that's for synching the GUI
to data in a SQL database. Is there anything simple like a slightly
more complicated list box? Even if I could use a listbox of strings
which align the text into multiple columns with tabs I would be happy.

Zytan

May 15 '07 #1
5 1520
I can see there's several 3rd party grid controls. Any of them
recommended?

I just need something simple. I have an array of elements, and each
element has several pieces of data. I'd like to show them row aligned
and column aligned.

Zytan

May 15 '07 #2
ListView in the "details" view would seem to fit the description; but
don't be fooled by the name; DataGridView will work for any data that
fits the standard pattern (which reflection does for you 9 times out
of 10), and can be used very successfully bound to properties on
regular classes. Or irregular classes if you don't mind writing your
own view ;-p

The advantage of DataGridView over ListView is that you don't need to
fill the columns yourself - just hand it a list and hey presto: data.
It can also be editable etc.

Marc

May 15 '07 #3
Just out of interest : have you tried:

dataGridView1.DataSource = myArray;

?

Since arrays implement IList, this will give you one row per element;
and likewise reflection will provide the columns based on public
properties (with AutoGenerateColumns=true, which is the default). If
you don't want *all* the properties you can add the columns manually
quite easily.

Marc

May 15 '07 #4
Just out of interest : have you tried:
>
dataGridView1.DataSource = myArray;
No, I just did now with an array of 3 strings, and it shows the length
of each string. It must do this because Length is a property of the
string.
Since arrays implement IList, this will give you one row per element;
and likewise reflection will provide the columns based on public
properties (with AutoGenerateColumns=true, which is the default).
Yup, so that's what is causing this.
If
you don't want *all* the properties you can add the columns manually
quite easily.
Thanks, Marc! I will toy with this for a bit.

Zytan

May 15 '07 #5
ListView in the "details" view would seem to fit the description;

No, I don't want a list shown in a grid pattern. I already have 2D
data, like an excel sheet of data, and I want to show it in the grid.
The advantage of DataGridView over ListView is that you don't need to
fill the columns yourself - just hand it a list and hey presto: data.
Yes, very powerful!
It can also be editable etc.
Yup. It must be user-editable. I think I'll turn that off. I just
want to show the data, not allow someone to change it.

Zytan

May 15 '07 #6

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

Similar topics

1
by: Umesh | last post by:
Hi I am developing a windows application. This contains a Data grid which will populate data from a data table in a Dataset. The application will do some calculation and store the result in the...
2
by: MrNobody | last post by:
I would like to make a quick little hex editor so I need to display hex string pairs like a grid- if anyone is familiar with hex editors you'll know what I mean. I could accomplish this by using a...
3
by: Tony Johansson | last post by:
Hello!! I need a product that could be used to create advanced grid. The requirement of the grid is the following: This grid has cells and in some cells not necessarilly a whole column but some...
0
by: Reza Nabi | last post by:
Dear All: Banckgroud: I have a datagrid which lives inside a repeater. Which is working fine. What i need is to dyanamically set the column width of the grid (which lieves inside the repeater)....
2
by: Marty | last post by:
Hi, I'm evaluating the Component One grid. I would like to know if this grid support my scenario, and secondly, what do I need in term of objects to achieve it. My application will receive a...
9
by: totalgeekdom | last post by:
Background: The problem I'm trying to solve is. There is a 5x5 grid. You need to fit 5 queens on the board such that when placed there are three spots left that are not threatened by the queen. ...
5
by: Flack | last post by:
Hey guys, Here is what I am trying to achieve: I have a grid, and every once in a while the grid will receive a message to add a new row and highlight it (change the backcolor) for five...
9
by: Dadio | last post by:
Hi! I have to take some strings from a file and put them in a record... The various strings in the file are written on this way: string1|string2|string3|string4|string5| This is the program...
0
by: zafar | last post by:
I don't know what property should be used for hiding colums in Data Grid, whereas in Data Grid View we have DataGridView1.Colums(index).Visible = False , But how can I hide Colums in Data Grid.....
4
by: svgeorge | last post by:
I NEED TO COLLECT FROM THE GRIDVIEW(DATASELECTED) IN TO A TABLE(SelectedPayment) -------------------------------------------------------------------------------- How TO COLLECT THE ROWS...
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
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
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
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...
0
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...
0
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 ...

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.