What object is selected for a MouseUp event

T

tshad

I am use the MouseUp event to tell me which row in my DataGrid
(EmailDataGrid) was selected - as follows:
***********************************************************
Private Sub EmailDataGrid_MouseUp(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles
EmailDataGrid.MouseUp
Dim numRows As Integer =
EmailDataGrid.BindingContext(EmailDataGrid.DataSource, _
EmailDataGrid.DataMember).Count

Call GetSelectedEmail(EmailDataGrid.CurrentRowIndex)
End Sub
**************************************************************

The problem is that if one of the column headers is selected to sort it,
this event gets called.

I thought I could use the CurrentRowIndex to tell what was selected, but it
is "0" as if the 1st row was selected.

How do I tell that the header was selected instead of a row?

Thanks,

Tom
 

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