Get reference to datagridview column from given coordinates.

  • Thread starter Thread starter jjeffers1
  • Start date Start date
J

jjeffers1

Does anyone know a method to retrieve a reference to the datagridview
column that contains given client coordinates?

Essentially I am trying to implement drag and drop functionality from a

listbox to a datagridview. In this case I am using an item dragged from

the listbox into the datagridview to rename the datagridview column
where that item is dropped.
I know how to implement the drag and drop functioanlity using events. I

just dont know how to get a reference to the actual column where the
item is dropped. So far I have gotten as far as being able to retrieve
the client coordinates in the datagridview of the actual drop point.
Anyone know how I can use those to get a reference to the column?


Thanks in advance for any help.
 
jjeffers1,

Look at DataGrid's HitTest method. It should give you everything you want.
 
Stoitcho said:
jjeffers1,

Look at DataGrid's HitTest method. It should give you everything you want.

Stoitcho - Thank you so much! It went through intellisense several
times but somehow missed this method.
 
Back
Top