is there a control that displays a multi-column array of rectangles

  • Thread starter Thread starter active
  • Start date Start date
A

active

I need a control that displays a grid of rectangles.

That is, like a brick wall except the rectangles are lined up.

In VB6 I used such a control (may have been called FlexGrid but I'm not
sure.)

I did see the DataGrid control but that seems oriented to DB usage. It's
probably much more complex than what I need, but I'm not sure about that!

Bottom line: is there a control that displays a multi-column array of
rectangles that can each contain text?


Thanks
 
active said:
I need a control that displays a grid of rectangles.

That is, like a brick wall except the rectangles are lined up.

In VB6 I used such a control (may have been called FlexGrid but I'm not
sure.)

I did see the DataGrid control but that seems oriented to DB usage. It's
probably much more complex than what I need, but I'm not sure about that!

Bottom line: is there a control that displays a multi-column array of
rectangles that can each contain text?


Thanks

Do you need to edit the values in the Grid, and by the way you could think
of new controls as the Grandchildren of FlexGrid. FlexGrid was made to work
with databases but most people I know only used it unbound.

The DataGrid is easy to work with and can be used unbound in the same
fashion as FlexGrid. Perhaps if you gave a little info on what your app
does we can help.

Lloyd Sheen
 
I simply want to display the grid of strings in the cells. And be able to
tell which cell a mouse clicked. No user editing. I'll look at DataGrid
unless you recommend something else.

Thanks
 
active said:
I simply want to display the grid of strings in the cells. And be able to
tell which cell a mouse clicked. No user editing. I'll look at DataGrid
unless you recommend something else.

Thanks

If you have a simple need to display then perhaps the ListView is what you
need. It has column headers and with a little coding you can get the row
and column that was clicked.

It is also simple to add column sorting and such. Lots of good examples on
web.

Depending on where your data is coming from this might be a simple approach
and users will be familar with the control from other windows apps.

Hope this helps.

Lloyd Sheen
 
Hi,

Loyd is certainly a version 1.x user, otherwise he had adviced you for sure
the DataGridView what has the same purpose as the flexgrid.

With the datagrid it is almost impossible to work with a datatable, with the
listview it is almost impossible to work with data while only the first
column is editable on a reasonable way, and than even troublefull.

Cor
 
I don't know why I didn't think of ListView. I've used it before. Maybe
because I don't need column headers and all the cells need to be the same
size my need looks different than the typical ListView.

Thanks
 
Loyd mentioned DataGridView in his first post. I should have specified the
application better at the start. Maybe if I said: I need to display a table
of static text (not from a database) that would have helped.

Anyway, I'm trying to use a DataGridView but all the doc I can find relates
to displaying data from a database.

I need a simple example, like a 3-row, 3-column DataGridView with the row
and column number displayed in the text cells.

Thanks for replying
 
I want to use a DataGridView if that is reasonable since I've never used it
before.


I should have specified the application better at the start.
I need to display a simple table of static text (not from a database).

I tried to figure out how to create the table.
There is many examples available but all for bound usage.

Thinking I could do it like it is done for a ListView.
That is, by adding a row and then adding cells to the row.
Later adding the text.
But I can't find out how to do that.

I think I could build an array objects (each object containing the strings
for a row) and bind that to the DataGridView. Is that the way I should do
it?

If not, I could use a simple example, like a 3-row, 3-column DataGridView
with the row and column number displayed in the text cells.

Thanks
 
Cor Ligthert said:
Hi,

Loyd is certainly a version 1.x user, otherwise he had adviced you for
sure the DataGridView what has the same purpose as the flexgrid.

With the datagrid it is almost impossible to work with a datatable, with
the listview it is almost impossible to work with data while only the
first column is editable on a reasonable way, and than even troublefull.

Cor
Hey Cor,

I was always taught to ask before making an assumption. I am a V2 user.

Lloyd
 
I found an example in the docs that shows exactly what I need:
How to: Create an Unbound Windows Forms DataGridView Control

Thanks
 
Back
Top