Get reference to datagridview column from given coordinates.

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

Stoitcho Goutsev \(100\)

jjeffers1,

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

jjeffers1

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top