Get reference to Combobox in Datagridview

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • hvj@paralax.nl

    Get reference to Combobox in Datagridview

    Hi all,

    I'm stuck on the following seemingly easy issue?

    When I know the row nr and column nr of a cell in a datagridview with
    a combobox in it how do I get a reference to that combobox?

    Help would be very much appreciated.

    Regards,
    Henk
  • Leon Mayne

    #2
    Re: Get reference to Combobox in Datagridview

    hvj@paralax.nl wrote:
    Hi all,
    >
    I'm stuck on the following seemingly easy issue?
    >
    When I know the row nr and column nr of a cell in a datagridview with
    a combobox in it how do I get a reference to that combobox?
    >
    Help would be very much appreciated.
    >
    Regards,
    Henk
    Something like (for row 1, column 2):

    Dim ddlYourDropDown As DropDownList =
    CType(CType(Me. GridView1.Contr ols(0),
    Table).Rows(1). Cells(2).FindCo ntrol("ddlYourD ropDown"), DropDownList)

    Comment

    • hvj@paralax.nl

      #3
      Re: Get reference to Combobox in Datagridview

      On 25 jul, 13:47, Leon Mayne <leon.rm...@mvp s.orgwrote:
      h...@paralax.nl wrote:
      Hi all,
      >
      I'm stuck on the following seemingly easy issue?
      >
      When I know the row nr and column nr of  a cell in a datagridview with
      a combobox in it how do I get a reference to that combobox?
      >
      Help would be very much appreciated.
      >
      Regards,
      Henk
      >
      Something like (for row 1, column 2):
      >
      Dim ddlYourDropDown As DropDownList =
      CType(CType(Me. GridView1.Contr ols(0),
      Table).Rows(1). Cells(2).FindCo ntrol("ddlYourD ropDown"), DropDownList)
      Thanks for the try Leon, but gridview1.Contr ols does not contain
      something that can be cast to Table. In my case it only contains the
      scrollbars.

      I found out that there isn't even a edit control for every cell. Not
      until some cell gets in the editmode an edit control is instantiated.
      And with dataGridview.Ed itingControl it can be retreived.

      Comment

      Working...