Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 27 Apr 2024, 17:34

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: 11 May 2012, 09:08 
Offline

Joined: 09 Feb 2012, 17:05
Posts: 124
Hello,
I've a problem on filter in dbgrid when the filed is linked to another cds

the problem is in dbgrideh
Line 29244
Before ParseExpression(Value);
FExpression.Operand1 = 'Ok' ( see my example below )
After
FExpression.Operand1 = 1

but i think it try to do the same in
SetLookupKeyValues(FExpression.Operand1); Line 29249
so after
FExpression.Operand1 is null


Example i have a table status
(Tclientdataset )
ID ; LIB
-----------
1 ; Ok
2 ; NotOk

in the list i've the ref to the status
so i see STFilter is linked to the TClientdataset

NUMBER ; STATUS
N12 ; Ok
N13 ; Ok
N14 ; NotOk

Status
filter on nul value when i try to filter on status OK

Many thanks for any idea


Top
 Profile  
 
PostPosted: 12 May 2012, 00:29 
Offline

Joined: 09 Feb 2012, 17:05
Posts: 124
Hello Dmitry,

In this project you can see that you use the listfield to build the filter instead the keyfield in the STFilter

Best regards
Rico

Attachment:
filter.zip [113.34 KiB]
Downloaded 370 times


Top
 Profile  
 
PostPosted: 13 May 2012, 21:20 
Offline
Администратор

Joined: 22 Dec 2011, 20:19
Posts: 335
Hello Rico.

In the project you have first colum with title 'Filter OK with listfield = ID' where a filter works correctly, as it must.
You set
STFilter.KeyField = 'ID'
STFilter.ListField = 'ID'
but Grid show values in the droped down list from the Column.PickList as it determines automatically that Column.PickList and Column.KeyList is not Empty and substitutes values from Column.PickList and you see 'lib1',... instead of 1,2...

So the first colum is customized correctly and works.

Best regards
Admin

_________________
Best regards
Admin


Top
 Profile  
 
PostPosted: 13 May 2012, 22:43 
Offline

Joined: 09 Feb 2012, 17:05
Posts: 124
Hello Dmitry,

Thank you for the answer.

Quote:
Grid show values in the droped down list from the Column.PickList as it determines automatically that Column.PickList and Column.KeyList is not Empty and substitutes values from Column.PickList and you see 'lib1',... instead of 1,2...

Yes I saw this, but could you confirm that it doesn't work like this in ehlib 4.2 ?
I have migrate my project to 5.6 from 4.2 and in 4.2 I am pretty sure that it doesn't do that, I have STFilter.ListField = 'LIB'.
If you say me yes and that is like this now, no problem I do the changes ...

PS : I don't understand why you use listfield instead the idfield to build the filter, because to me, the listfield sould be only display in the droped down list and nothing else :?:


Best regards
Rico


Top
 Profile  
 
PostPosted: 14 May 2012, 10:20 
Offline

Joined: 09 Feb 2012, 17:05
Posts: 124
Hello Dmitry,

In the same project I have set the STFilter like this and it works too !!
STFilter.KeyField = ''
STFilter.ListField = 'LIB'

It is correct to do that ? I suppose you build the filter with the keylist in this case ..

Why don't build filter always with keylist ?

Thank you

Best regards
Rico


Top
 Profile  
 
PostPosted: 21 May 2012, 23:32 
Offline

Joined: 09 Feb 2012, 17:05
Posts: 124
Hello Dmitry,

In the same project, try to use custom filter with first column set like this :
STFilter.KeyField = 'ID'
STFilter.ListField = 'ID'

The displayed values are the Column.KeyList and not the column.pickList in the custom filter window (1,2,3) , but values are correct in the filter (lib1,lib2,lib3)
I hope you are agree this time to say that this setting is not OK

If I set STFilter like this
STFilter.KeyField = ''
STFilter.ListField = 'ID'

Values are the column.pickList as it must and the filter is ok

If I set STFilter like this
STFilter.KeyField = 'ID'
STFilter.ListField = 'LIB'

Values are the column.pickList, but the filter doesn't work (exception)

How is the correct setting ?

Best regards
Rico


Top
 Profile  
 
PostPosted: 23 May 2012, 07:28 
Offline

Joined: 09 Feb 2012, 17:05
Posts: 124
Hello Dmitry

I don't know if you have see the problem, so I send a screenShot ...

If you don't answer after this, I can't do anything else to show you, that use STFilter.ListField = 'ID' is not correct...
You can't say that show ID instead the listValue to the end users works as it must.

Attachment:
customFilterValues.jpg
customFilterValues.jpg [ 45.71 KiB | Viewed 4879 times ]


Best regards
Rico


Top
 Profile  
 
PostPosted: 13 Jun 2012, 21:01 
Offline

Joined: 09 Feb 2012, 17:05
Posts: 124
Bug fixed in EhLib 5.6 Build 5.6.235
Thank you


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 82 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group