![]() |
Datenbank: Absolute database • Version: 2011 • Zugriff über: SQL
DBGrid filtering
Liste der Anhänge anzeigen (Anzahl: 1)
Hi friends,
I need the DBGrid display only records from the "A" to "D". Thanks |
AW: DBGrid filtering
![]() ![]() Oder bei "besseren" Komponenten ala DevExpress, da gibt es auch noch eine zusätzliche Filterung im Grid/DataControler, welche man nutzen könnte. |
AW: DBGrid filtering
Zitat:
Delphi-Quellcode:
Thanks
with dm.ds_distributor.DataSet do begin
Filtered := False; Filter := 'Firma = ' + QuotedStr(Uppercase('A')) + ' OR ' + 'Firma = ' + QuotedStr(Uppercase('D')) + ' OR ' + 'Firma = ' + QuotedStr(Lowercase('A')) + ' OR ' + 'Firma = ' + QuotedStr(Lowercase('D')); Filtered := True; end;; |
AW: DBGrid filtering
Alternatively you could use a Query-Component with a SQL-Statement like this:
SQL-Code:
SELECT
<Fieldlist> FROM <your table> WHERE UPPER(Firma) IN ('A', 'B', 'C', 'D') |
AW: DBGrid filtering
I'd prefer SQL, but perhaps you would prefer the Event OnFilterRecord
|
AW: DBGrid filtering
Zitat:
Delphi-Quellcode:
I am interested in the possibility onFilterRecord.
SELECT *
FROM distributor WHERE Firma >='A' AND Firma <'D' |
AW: DBGrid filtering
Then RTFM and find out. It seems as if you always want us to do the work.
Implementing an OnFilterRecord-Event is as simple as posting a question here. Go on! |
AW: DBGrid filtering
Zitat:
|
AW: DBGrid filtering
Hmmm.
Entering the Eventname plus 'example' in Google and press 'search'? Easy. Read the examples? Easy. Open Delphi and load the project? Easy. Find the event in the objectinspector? Easy. Doubleclick? Easy. Adapt the example found in google? ... |
AW: DBGrid filtering
Zitat:
Delphi-Quellcode:
That's what I needed without google ....
with dm.ds_distributor.DataSet do begin
Filtered := False; Filter := 'Firma <> ' + QuotedStr('A') + ' AND ' + 'Firma <= ' + QuotedStr('D'); Filtered := True; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:25 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz