[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 154
  • Last Modified:

Preventing edit, insert and delete

How can i prevent edit, insert and delete on some records
in dbgrid.
I work with the dbnavigator and dbgrid.

0
gipa
Asked:
gipa
1 Solution
 
ZifNabCommented:
Well you can check for an OnStateChange or an OnUpdate (events of your DataSource).
In these events you can check which record is active and then change the state of the table to what you want. I think OnStateChange is better then OnUpdate.
Haven't tried this out. But I think it's a good idea and should work.

You can also use the Before or After Insert, Edit Delete events of TTable component.
0
 
gipaAuthor Commented:
Thank you Zifnab.
It works.

OnstateChange
  if .... then
    DataSource1.DataSet.Cancel;
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now