Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > DB-Aware

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 09-27-2003, 05:54 AM
carlo_um carlo_um is offline
Senior Member
 
Join Date: May 2001
Posts: 133
Default Prevent adding of record on DBGrid.

I'm using a dbgrid and the user has the option to edit one of the fields but is not allowed to add another record. Are there anyway to prevent the user from adding a record but can still edit the existing records?

I can't make the readonly to true since the user can no longer edit if readonly property is change to true.
Reply With Quote
  #2  
Old 09-27-2003, 02:54 PM
dirso dirso is offline
Senior Member
 
Join Date: Mar 2001
Posts: 441
Default RE: Prevent adding of record on DBGrid.

Hi,

In the AfterInsert Method of ur TTabel or TQuery write this:
<cb>DataSet.Cancel;</cb>

I hope it helps,
Dirso
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:59 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.