Adding a datagrid by code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • amber

    #1

    Adding a datagrid by code

    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

  • Cor Ligthert

    #2
    Re: Adding a datagrid by code

    Amber,

    In this message is a sample I once made



    I hope this helps,

    Cor


    Comment

    • Cor Ligthert

      #3
      Re: Adding a datagrid by code

      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


      Comment

      Working...