Get reference to Combobox in Datagridview

  • Thread starter Thread starter hvj
  • Start date Start date
H

hvj

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
 
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.Controls(0),
Table).Rows(1).Cells(2).FindControl("ddlYourDropDown"), DropDownList)
 
Something like (for row 1, column 2):

Dim ddlYourDropDown As DropDownList =
CType(CType(Me.GridView1.Controls(0),
Table).Rows(1).Cells(2).FindControl("ddlYourDropDown"), DropDownList)

Thanks for the try Leon, but gridview1.Controls 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.EditingControl it can be retreived.
 
Back
Top