[Lazarus] How to avoid DBGrid showing new blank record

frans fjf.vanleeuwen at quicknet.nl
Thu Jun 1 14:38:24 CEST 2017


Hi.
I'm using Lazarus 1.6.4 and FPC 3.0.2, combined with a Firebird 
database. I've added all the fields of a table and use a datadictionary. 
I show the data in de DBGrid and use a seperate form to manipulate the 
data and to insert a new record.
When inserting a new record, the DBGrid expands with a blank record. I 
don't like that, I wish the DBGrid to show only the valid records and a 
new record is not a valid record yet.
1. I've tried this with a query 'select * from dataset where number is 
not null'. This doesn't work.
2. I've tried this with dataset.Disablecontrols (and enablecontrols), 
this doesn't work either.
3. I've activated the option dgDisableInsert, that doesn't work either.
The only solution I found is to use in the DBGrid a seperate view I 
created in the database. It works, but I keep wondering if there is an 
other solution possible.

-- 
mvg
Frans van Leeuwen
M 06-51695390


---
Deze e-mail is gecontroleerd op virussen door AVG.
http://www.avg.com



More information about the Lazarus mailing list