This is a multi-part message in MIME format.

------=_NextPart_000_0025_01C6DE8A.C9B4CBC0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I want to display data from a database as labels on a form without using =
a datagrid.
My problem is that I can't make the labels at design time because the =
amount of data is variable.
It should look a bit like this:

John 1/8/1970 Edit Remove
Peter 8/2/1972 Edit Remove
etc.

Creating a data source and dragging columns to the form doesn't seem to =
be the right solution for me because my data source should be something =
like "SELECT name, birthdate FROM people WHERE postcode=3D<selected =
value in a combobox on this form>"

The only obvious way I can see is to write code that creates labels, =
positions them and possibly make the form bigger if it doesn't all fit, =
but this seems like a lot of work and this seems such a common thing =
that I'd be surprised that there isn't a control (like a table) for this =
or something.
Easy enough on a web page I think, just add rows to a table, but this is =
a Windows form.
I don't like a datagrid so much because I don't think I can put buttons =
or labels like Edit (or a picture of a rubbish bin) in a datagrid.

Thanks for any help,

Peter
------=_NextPart_000_0025_01C6DE8A.C9B4CBC0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>I want to display data from a database =
as labels on=20
a form without using a datagrid.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>My problem is that I can't make the =
labels at=20
design time because the amount of data is variable.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>It should look a bit like =
this:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial><FONT size=3D2>John&nbsp;&nbsp;&nbsp;=20
1/8/1970&nbsp;&nbsp;&nbsp; <U>Edit</U> &nbsp;&nbsp;&nbsp;=20
<U>Remove</U></FONT></FONT></DIV>
<DIV><FONT face=3DArial><FONT size=3D2>Peter&nbsp;&nbsp;&nbsp;=20
8/2/1972&nbsp;&nbsp;&nbsp; <U>Edit</U> &nbsp;&nbsp;&nbsp;=20
<U>Remove</U></FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>etc.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Creating a data source and dragging =
columns to the=20
form doesn't seem to be the right solution for me because my data source =
should=20
be something like "SELECT name, birthdate FROM people WHERE=20
postcode=3D&lt;selected value in a combobox on this =
form&gt;"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The only obvious way I can see is to =
write code=20
that creates labels, positions them and possibly make the form bigger if =
it=20
doesn't all fit, but this seems like a lot of work and this seems such a =
common=20
thing that I'd be surprised that there isn't a control (like a =
table)&nbsp;for=20
this or something.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Easy enough on a web page I think, just =
add rows to=20
a table, but this is a Windows form.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I don't like a datagrid so much because =
I don't=20
think I can put buttons or labels like <U>Edit</U> (or a picture of a =
rubbish=20
bin) in a datagrid.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks for any help,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Peter</FONT></DIV></BODY></HTML>

------=_NextPart_000_0025_01C6DE8A.C9B4CBC0--

RE: How to display data on a Windows form (without using a datagrid)?. by Scott

Scott
Fri Sep 22 14:51:01 CDT 2006

If you're using Whidbey (2.0), I'd suggest taking a peek at DataGridView,
which is a more advanced grid that addresses the problems you had with
DataGrid. If you don't want to do that, you could use TableLayoutPanel
(again only in 2.0).

If you're using 1.0 or 1.1, I'm afraid you're right: you'd either need to
write your own control or find a 3rd party control that does this for you.
-Scott

"Peter Demeyer" wrote:

> I want to display data from a database as labels on a form without using a datagrid.
> My problem is that I can't make the labels at design time because the amount of data is variable.
> It should look a bit like this:
>
> John 1/8/1970 Edit Remove
> Peter 8/2/1972 Edit Remove
> etc.
>
> Creating a data source and dragging columns to the form doesn't seem to be the right solution for me because my data source should be something like "SELECT name, birthdate FROM people WHERE postcode=<selected value in a combobox on this form>"
>
> The only obvious way I can see is to write code that creates labels, positions them and possibly make the form bigger if it doesn't all fit, but this seems like a lot of work and this seems such a common thing that I'd be surprised that there isn't a control (like a table) for this or something.
> Easy enough on a web page I think, just add rows to a table, but this is a Windows form.
> I don't like a datagrid so much because I don't think I can put buttons or labels like Edit (or a picture of a rubbish bin) in a datagrid.
>
> Thanks for any help,
>
> Peter

Re: How to display data on a Windows form (without using a datagrid)?.. by Stoitcho

Stoitcho
Fri Sep 22 15:31:19 CDT 2006

This is a multi-part message in MIME format.

------=_NextPart_000_0184_01C6DE64.88A490A0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Peter,

My advice is not go with too many controls. If you do, your next =
question will be "why my application is so slow".=20
There is always a reasonable amount of controls that can be put on a =
form and the number is not that big. =
How-to-speed-up-my-application-that-has-hundreds-controls-on-the-form =
questions has been asked many times in the newsgroups. So my advice is =
use some kind of a grid control or draw your data, but don't use =
controls for each small piece of information there. If you need editing =
for example use one control and move it over the data that needs to be =
edited; don't create hundreds of comboboxes for instance.

--=20
HTH
Stoitcho Goutsev (100)
"Peter Demeyer" <pdemeyer@telenet.be> wrote in message =
news:luWQg.90586$Sj5.1267825@phobos.telenet-ops.be...
I want to display data from a database as labels on a form without =
using a datagrid.
My problem is that I can't make the labels at design time because the =
amount of data is variable.
It should look a bit like this:

John 1/8/1970 Edit Remove
Peter 8/2/1972 Edit Remove
etc.

Creating a data source and dragging columns to the form doesn't seem =
to be the right solution for me because my data source should be =
something like "SELECT name, birthdate FROM people WHERE =
postcode=3D<selected value in a combobox on this form>"

The only obvious way I can see is to write code that creates labels, =
positions them and possibly make the form bigger if it doesn't all fit, =
but this seems like a lot of work and this seems such a common thing =
that I'd be surprised that there isn't a control (like a table) for this =
or something.
Easy enough on a web page I think, just add rows to a table, but this =
is a Windows form.
I don't like a datagrid so much because I don't think I can put =
buttons or labels like Edit (or a picture of a rubbish bin) in a =
datagrid.

Thanks for any help,

Peter
------=_NextPart_000_0184_01C6DE64.88A490A0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Peter,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>My advice is not go with too many =
controls. If you=20
do, your next question will be "why my application is so slow". =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>There is always a reasonable amount of =
controls=20
that can be put on a form and&nbsp;the number is&nbsp;not that big.=20
How-to-speed-up-my-application-that-has-hundreds-controls-on-the-form =
questions=20
has been asked many times in the newsgroups. So my advice is use some =
kind of a=20
grid control or draw your data, but don't use controls for each small =
piece of=20
information there. If you need editing for example use one control and =
move it=20
over the data that needs to be edited; don't create hundreds of =
comboboxes for=20
instance.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>-- </DIV>
<DIV>HTH<BR>Stoitcho Goutsev (100)</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Peter Demeyer" &lt;<A=20
href=3D"mailto:pdemeyer@telenet.be">pdemeyer@telenet.be</A>&gt; wrote =
in message=20
<A=20
=
href=3D"news:luWQg.90586$Sj5.1267825@phobos.telenet-ops.be">news:luWQg.90=
586$Sj5.1267825@phobos.telenet-ops.be</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>I want to display data from a =
database as labels=20
on a form without using a datagrid.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>My problem is that I can't make the =
labels at=20
design time because the amount of data is variable.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>It should look a bit like =
this:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial><FONT size=3D2>John&nbsp;&nbsp;&nbsp;=20
1/8/1970&nbsp;&nbsp;&nbsp; <U>Edit</U> &nbsp;&nbsp;&nbsp;=20
<U>Remove</U></FONT></FONT></DIV>
<DIV><FONT face=3DArial><FONT size=3D2>Peter&nbsp;&nbsp;&nbsp;=20
8/2/1972&nbsp;&nbsp;&nbsp; <U>Edit</U> &nbsp;&nbsp;&nbsp;=20
<U>Remove</U></FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>etc.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Creating a data source and dragging =
columns to=20
the form doesn't seem to be the right solution for me because my data =
source=20
should be something like "SELECT name, birthdate FROM people WHERE=20
postcode=3D&lt;selected value in a combobox on this =
form&gt;"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The only obvious way I can see is to =
write code=20
that creates labels, positions them and possibly make the form bigger =
if it=20
doesn't all fit, but this seems like a lot of work and this seems such =
a=20
common thing that I'd be surprised that there isn't a control (like a=20
table)&nbsp;for this or something.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Easy enough on a web page I think, =
just add rows=20
to a table, but this is a Windows form.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I don't like a datagrid so much =
because I don't=20
think I can put buttons or labels like <U>Edit</U> (or a picture of a =
rubbish=20
bin) in a datagrid.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks for any help,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>Peter</FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0184_01C6DE64.88A490A0--


Re: How to display data on a Windows form (without using a datagrid)?.. by Peter

Peter
Sun Sep 24 15:30:49 CDT 2006

This is a multi-part message in MIME format.

------=_NextPart_000_0024_01C6E029.15766740
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Thank you both for your advise.
I will have a look at the DataGridView then, even though it doesn't look =
so nice and it doesn't look like I can make "Edit" and "Remove" buttons =
next to each record.

------=_NextPart_000_0024_01C6E029.15766740
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Thank you both for your =
advise.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I will have a look at the DataGridView =
then, even=20
though it doesn't look so nice and it doesn't look like I can make =
"Edit" and=20
"Remove" buttons next to each record.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_0024_01C6E029.15766740--