471,356 Members | 1,657 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,356 software developers and data experts.

Adding a datagrid by code

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...

Jul 21 '05 #1
2 1024

In this message is a sample I once made


I hope this helps,

Jul 21 '05 #2

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.

Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Clayton Hamilton | last post: by
5 posts views Thread by Phil Townsend | last post: by
4 posts views Thread by Chris | last post: by
3 posts views Thread by Jim Heavey | last post: by
2 posts views Thread by Tomek R. | last post: by
3 posts views Thread by Fao, Sean | last post: by
2 posts views Thread by Flack | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.