PDA

Click to See Complete Forum and Search --> : Problems With Editing Values In Datagrid...


JonnyCab
Nov 1st, 2000, 04:08 PM
Hi again,

I have a problem when editing values in a datagrid.
I use the Sub....DataGrid1_BeforeUpdate(Cancel As Integer)
...to validate edited value. Problem is.. if the user types in a new value and presses the process button, without going to another datagrid field first, this sub is not triggered and the change does not appear to be recognised.

Any help on this would be appreciated.

Cheers Jonny

AdrianH
Nov 1st, 2000, 06:06 PM
You could use the BeforeColEdit and ColEdit functions of the grid to trap when the user is actually editing a cell in your grid.

Adrian.

JonnyCab
Nov 2nd, 2000, 03:30 AM
I had a brief look at those but wasn't sure whether these actions accured before of after BeforeColUpdate. I also couldn't find an example in MSDN stuff.

If anyone has some code example using BeforeColEdit or ColEdit with Datagrids that would be helpfull.

Cheers Jonny

Orpheus
Nov 2nd, 2000, 10:27 AM
I have previously had this problem before when using Visual RPG!

The solution that I came up with was to use a "cmdProcess.SetFocus" at the beginning of the processing function. This caused the focus to be lost be the edit control, thus triggerring the validation routine.

I guess the same might work with the dbGrid control - something about it has to work ...

JonnyCab
Nov 2nd, 2000, 06:03 PM
That sounds like a cunning plan... I'll try that out

Thats again Orpheus