Datagridview keypress event question

B

Bob

In that event, how can you find out if the keypress event was in a certain
column? Say you have datagridview1, columnname1, columnName2
You want to do something only with the keypress event of column2, do nothing
special with column1

Private Sub Datagrid1_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles Datagrid1.KeyPress

If Me.datagrid1......... Then - how do you specify its for column2,
can't find the way via intellisense properties



End If

End Sub

Thanks for any help

Bob
 
B

Bob

Found it!
Its
If Me.DataGRidview1.CurrentCell.OwningColumn.DataPropertyName =
"MyDataPropertyName" Then

Talk about going around incircles to get something done !
hehehe

Bob
 

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