Dataview cell value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I am a newbi to this fourm and to vb.net.... moving from vb classic.
Testing with a database connection, got my data in the dataview control.
But now, I want to be able to double click a row and return a value from a
cell. Something like what use to be the textmatrix in MSHFlex grid.
How would I do that?
Brian
 
Hi,

Handle the rowheadermousedoubleclick event to get the value of a
column when the row header is double clicked and the cellmousedoubleclick
event to get the value when a cell is double clicked.

Private Sub DataGridView1_RowHeaderMouseDoubleClick(ByVal sender As
Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs)
Handles DataGridView1.RowHeaderMouseDoubleClick
MessageBox.Show(DataGridView1.Item(0, e.RowIndex).Value.ToString)
End Sub


Private Sub DataGridView1_CellMouseDoubleClick(ByVal sender As Object,
ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles
DataGridView1.CellMouseDoubleClick
If e.ColumnIndex < 0 Or e.RowIndex < 0 Then Return
MessageBox.Show(DataGridView1.Item(e.ColumnIndex,
e.RowIndex).Value.ToString)
End Sub


Ken
 

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

Back
Top