Adding a datagrid by code

G

Guest

Hello,
I need to add a combobox to a datagrid.
I've found quite a few resources on the net with code on how to do it, but
I'm confused where to do it.
If I do it all using the toolbox/datagrid properties - I have no problem
making a simple datagrid.
When I go through all the "Windows Form Designer generated code" there is
code refering to the datagrid everywhere.
Do I need to add any code in here? Or can I just do it all outside the "
Windows Form Designer generated code" as I would with other code...
Amber
 
C

Cor Ligthert

Amber,

In this sample is the datagrid not added by code, however the rest of your
question is done.

Adding a datagrid by code is as well not that much work. What basic is done
that is that there is private a control is placed where in VB the addition
is done. "WithEvents".

Than the Grid is constructed where as well are set the place on the form as
top and left plus the weidth and the height,

You can do that yourself, however dragging has the same effect.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top