Home All Groups Group Topic Archive Search About

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

Author
3 May 2007 5:30 PM
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

Author
3 May 2007 5:37 PM
Lloyd Sheen
Show quote Hide quote
" active" <activeNOSPAM@a-znet.com> wrote in message
news:u9cnEjajHHA.4676@TK2MSFTNGP02.phx.gbl...
>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
Author
3 May 2007 6:08 PM
active
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


Show quoteHide quote
"Lloyd Sheen" <a@b.c> wrote in message
news:%23sxH0najHHA.2272@TK2MSFTNGP02.phx.gbl...
>
> " active" <activeNOSPAM@a-znet.com> wrote in message
> news:u9cnEjajHHA.4676@TK2MSFTNGP02.phx.gbl...
>>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
Author
3 May 2007 9:10 PM
Lloyd Sheen
Show quote Hide quote
" active" <activeNOSPAM@a-znet.com> wrote in message
news:eFEAF4ajHHA.4464@TK2MSFTNGP03.phx.gbl...
>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
>
>
> "Lloyd Sheen" <a@b.c> wrote in message
> news:%23sxH0najHHA.2272@TK2MSFTNGP02.phx.gbl...
>>
>> " active" <activeNOSPAM@a-znet.com> wrote in message
>> news:u9cnEjajHHA.4676@TK2MSFTNGP02.phx.gbl...
>>>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
>
>

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
Author
4 May 2007 1:29 PM
active
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



Show quoteHide quote
"Lloyd Sheen" <a@b.c> wrote in message
news:exi$decjHHA.3700@TK2MSFTNGP06.phx.gbl...
>
> " active" <activeNOSPAM@a-znet.com> wrote in message
> news:eFEAF4ajHHA.4464@TK2MSFTNGP03.phx.gbl...
>>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
>>
>>
>> "Lloyd Sheen" <a@b.c> wrote in message
>> news:%23sxH0najHHA.2272@TK2MSFTNGP02.phx.gbl...
>>>
>>> " active" <activeNOSPAM@a-znet.com> wrote in message
>>> news:u9cnEjajHHA.4676@TK2MSFTNGP02.phx.gbl...
>>>>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
>>
>>
>
> 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
Author
4 May 2007 1:22 AM
Cor Ligthert [MVP]
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

Show quoteHide quote
" active" <activeNOSPAM@a-znet.com> schreef in bericht
news:eFEAF4ajHHA.4464@TK2MSFTNGP03.phx.gbl...
>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
>
>
> "Lloyd Sheen" <a@b.c> wrote in message
> news:%23sxH0najHHA.2272@TK2MSFTNGP02.phx.gbl...
>>
>> " active" <activeNOSPAM@a-znet.com> wrote in message
>> news:u9cnEjajHHA.4676@TK2MSFTNGP02.phx.gbl...
>>>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
>
>
Author
4 May 2007 1:37 PM
active
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



Show quoteHide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:%23QBnCpejHHA.4624@TK2MSFTNGP03.phx.gbl...
> 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
>
> " active" <activeNOSPAM@a-znet.com> schreef in bericht
> news:eFEAF4ajHHA.4464@TK2MSFTNGP03.phx.gbl...
>>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
>>
>>
>> "Lloyd Sheen" <a@b.c> wrote in message
>> news:%23sxH0najHHA.2272@TK2MSFTNGP02.phx.gbl...
>>>
>>> " active" <activeNOSPAM@a-znet.com> wrote in message
>>> news:u9cnEjajHHA.4676@TK2MSFTNGP02.phx.gbl...
>>>>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
>>
>>
>
>
Author
4 May 2007 4:01 PM
Lloyd Sheen
Show quote Hide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:%23QBnCpejHHA.4624@TK2MSFTNGP03.phx.gbl...
> 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
>
> " active" <activeNOSPAM@a-znet.com> schreef in bericht
> news:eFEAF4ajHHA.4464@TK2MSFTNGP03.phx.gbl...
>>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
>>
>>
>> "Lloyd Sheen" <a@b.c> wrote in message
>> news:%23sxH0najHHA.2272@TK2MSFTNGP02.phx.gbl...
>>>
>>> " active" <activeNOSPAM@a-znet.com> wrote in message
>>> news:u9cnEjajHHA.4676@TK2MSFTNGP02.phx.gbl...
>>>>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
>>
>>
>
>
Hey Cor,

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

Lloyd
Author
4 May 2007 2:16 PM
active
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

Show quoteHide quote
>
>
> 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
Author
4 May 2007 6:38 PM
active
I found an example in the docs that shows exactly what I need:
How to: Create an Unbound Windows Forms DataGridView Control

Thanks