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> </DIV>
<DIV><FONT face=3DArial><FONT size=3D2>John =20
1/8/1970 <U>Edit</U> =20
<U>Remove</U></FONT></FONT></DIV>
<DIV><FONT face=3DArial><FONT size=3D2>Peter =20
8/2/1972 <U>Edit</U> =20
<U>Remove</U></FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>etc.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </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<selected value in a combobox on this =
form>"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </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) 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> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks for any help,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Peter</FONT></DIV></BODY></HTML>
------=_NextPart_000_0025_01C6DE8A.C9B4CBC0--