Datagrid not responding to events

G

Guest

I have a datagrid named grdSubClients

I have all but one column set as read only, and I'm trying to trap events
when the user enters data into the one editable column. I have formatted the
grid using column styles, but turning that off had no positive effect.

The issue is the following events seem like what I would want

Private Sub grdSubClients_TextChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles grdSubClients.TextChanged

or

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


However, no code that I put inside these subs gets hit when the user enters
data in the column.

I do get a hit on this event:

Private Sub grdSubClients_CurrentCellChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles grdSubClients.CurrentCellChanged

But it is of no use since it fires when it lands on the new cell and I don't
have any way of deriving the cell that they came from.

As a side note, the datagrid has been a huge source of frustration for me
and my team. I used a third party grid for my VB6 apps that was SO EASY. I
know that this grid can do all the things I need it to do (or at least I'm
pretty sure most), but the documentation is so buried and examples so hard to
find. I would buy a book that focused on the expert use of VB.Net controls,
especially the grid, in an instant. Hint hint.
 
K

Ken Tucker [MVP]

Hi,

http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q773q

VB.Net version of code
http://www.onteorasoftware.com/downloads/cellvalidation.zip

Ken
-----------------------
I have a datagrid named grdSubClients

I have all but one column set as read only, and I'm trying to trap events
when the user enters data into the one editable column. I have formatted
the
grid using column styles, but turning that off had no positive effect.

The issue is the following events seem like what I would want

Private Sub grdSubClients_TextChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles grdSubClients.TextChanged

or

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


However, no code that I put inside these subs gets hit when the user enters
data in the column.

I do get a hit on this event:

Private Sub grdSubClients_CurrentCellChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles grdSubClients.CurrentCellChanged

But it is of no use since it fires when it lands on the new cell and I don't
have any way of deriving the cell that they came from.

As a side note, the datagrid has been a huge source of frustration for me
and my team. I used a third party grid for my VB6 apps that was SO EASY. I
know that this grid can do all the things I need it to do (or at least I'm
pretty sure most), but the documentation is so buried and examples so hard
to
find. I would buy a book that focused on the expert use of VB.Net controls,
especially the grid, in an instant. Hint hint.
 

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