Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Datagrid and datasource onchange
Fri, Apr 28 2006 9:44 PMPermanent Link

"Lance R."
I'm sure many of you may have come up against this.

I'm using a TMSGrid to connect to a datasource connecting to a DBISAMQuery.

I have an onstatechange event set on the datasource to update button
states in terms of edit/cancel/undo/save so that when your browsing the
grid, appropriate buttons are enabled and when an edit is made, the
buttons set again.

The problem is when I change to a different row in the grid, I notice
the statechange check gets set several times and so my buttons appear to
"flash".

I looked and noticed the grid is doing a move by, which then leads me to
believe that its going to call that even X# of rows I make.

Suggestions on how you manage something similar?

Lance
Thu, May 25 2006 9:54 PMPermanent Link

Aaron Taylor
r u using delphi ?
if so what version ?
Fri, May 26 2006 2:15 AMPermanent Link

Graham Wood
Lance,

Get rid of the OnStateChange event and link the buttons to an ActionList.

??  Simple:

Drop an ActionList on your datamodule.  
Right click on it, select 'Action List Editor...'
Right click on the Categories box (the one on the left).
Select 'New Standard Action...'
Then scroll down to TDataSet and add the required actions.  

Link the buttons on your form to the actions.  Hey presto!  

Use F1 if you get stuck.  
HTH
Cheers,
Graham W.


Image