From: Patrick A on
All,

(Please pardon the cross-post, but I am not sure of the best place to
ask. Direction would be most welcome.)

I've used other (C#) code snippets found around here to try to
implement drag-n-drop in a DataGridView, to give the user a way to
sort the data in the grid.


I'm mostly there - I am able to drag, see the cursor change to drag,
and when I let go, the row I dragged leaves it's original spot.


Problem is, it "drops" into a black hole.
Here's the line I'm trying to "drop" with;

TBL_TimersDataGridView.Rows.Insert(RowIndexOfItemUnderMouseToDrop,
RowToMove)

The full code is below.
Can anyone tell me what I'm doing wrong?

Thanks,
Patrick


***************************************************************************­
***********************************


Private Sub TBL_TimersDataGridView_DragDrop(ByVal sender As Object,
ByVal e As System.Windows.Forms.DragEventArgs) Handles
TBL_TimersDataGridView.DragDrop
Dim ClientPoint As Point =
TBL_TimersDataGridView.PointToClient(New Point(e.X, e.Y))
RowIndexOfItemUnderMouseToDrop =
TBL_TimersDataGridView.HitTest(ClientPoint.X, ClientPoint.Y).RowIndex
If e.Effect = DragDropEffects.Move Then
Dim RowToMove As DataGridViewRow =
TBL_TimersDataGridView.Rows(RowIndexFromMouseDown) 'Gets row to move.


TBL_TimersDataGridView.Rows.RemoveAt(RowIndexFromMouseDown) 'Removes
the row when you finish drag-drop.


TBL_TimersDataGridView.Rows.Insert(RowIndexOfItemUnderMouseToDrop,
RowToMove) 'Does not work...
End If
End Sub
From: PvdG42 on

"Patrick A" <parkins(a)stradley.com> wrote in message
news:fbe6d903-1078-4ec6-aa85-09fe2c56676c(a)z3g2000yqz.googlegroups.com...
> All,
>
> (Please pardon the cross-post, but I am not sure of the best place to
> ask. Direction would be most welcome.)
>
<snip>

I'll address your first question. As you are using C#, I suggest this news
group as the place where you'll find the best help:

microsoft.public.dotnet.languages.csharp

Also, you're not cross posting (addressing multiple groups in the same
message, and acceptable if all groups are topical and restraint is
exercised) as you seem to think. If you sent the same content to multiple
groups in separate messages, that's multi-posting and is a definite no-no.
The good thing about *limited, topical* cross posting is that responses
automatically appear in all addressed groups, whereas my response to you
will appear only in dotnet.general, and not in any other groups where your
posted separate copies.



From: Patrick A on
Thanks for your reply. I wasn't clear - I am using VB - I
"translated" the C# into VB.

And thanks for the explanatiobn of "limited, topical" cross-posting,
I'll do that next time.

Patrick


On Mar 24, 10:05 am, "PvdG42" <pvd...(a)toadstool.edu> wrote:
> "Patrick A" <park...(a)stradley.com> wrote in message
>
> news:fbe6d903-1078-4ec6-aa85-09fe2c56676c(a)z3g2000yqz.googlegroups.com...> All,
>
> > (Please pardon the cross-post, but I am not sure of the best place to
> > ask.  Direction would be most welcome.)
>
> <snip>
>
> I'll address your first question. As you are using C#, I suggest this news
> group as the place where you'll find the best help:
>
> microsoft.public.dotnet.languages.csharp
>
> Also, you're not cross posting (addressing multiple groups in the same
> message, and acceptable if all groups are topical and restraint is
> exercised) as you seem to think. If you sent the same content to multiple
> groups in separate messages, that's multi-posting and is a definite no-no..
> The good thing about *limited, topical* cross posting is that responses
> automatically appear in all addressed groups, whereas my response to you
> will appear only in dotnet.general, and not in any other groups where your
> posted separate copies.

From: PvdG42 on

"Patrick A" <parkins(a)stradley.com> wrote in message
news:b8327dfc-c0bf-425b-a835-79ea9a8da96e(a)q23g2000yqd.googlegroups.com...
> Thanks for your reply. I wasn't clear - I am using VB - I
> "translated" the C# into VB.
>
> And thanks for the explanatiobn of "limited, topical" cross-posting,
> I'll do that next time.
>
> Patrick
>
Then, the group you need is:

microsoft.public.dotnet.languages.vb