EhLib.Com
https://forum.ehlib.com/en/

DbComboboxEh with Search "lsftContainsEh" does not find
https://forum.ehlib.com/en/viewtopic.php?f=5&t=1155
Page 1 of 1

Author:  Luciano_F [ 06 May 2022, 10:53 ]
Post subject:  DbComboboxEh with Search "lsftContainsEh" does not find

I don't want the user to type anything in "DbComboboxEh"
in this way I put "LimitTextToListValues = True"
I put the search for "DropDownBox.AutoFilterType = lsftContainsEh"

I put two items
'Campo Mourao'
'Movements'

If I type "Mo" when typing the letter "u" it crashes and cannot summarize for Item = 'Campo mourao'

See the attached video.
https://mega.nz/file/c2ZAEJDC#W_gGHiPNQ ... ykEJNg7f-A

Another problem is that if you have a number in front the search cannot be done
example :

1 - Campo Mourao
2 - Movement

if I type "M" nothing happens.

Author:  EhLibSupport [ 06 May 2022, 17:13 ]
Post subject:  Re: DbComboboxEh with Search "lsftContainsEh" does not find

Hello

1. If you populate the Items and KeyItems properties, then those properties must contain the same number of values. Otherwise, the behavior of the component may be unpredictable.

2. LimitTextToListValues = True and DropDownBox.AutoFilterType = lsftContainsEh are mutually exclusive properties.
To search through lsftContainsEh, you need to be able to enter text that is not in the list.
For your case, you need to remove LimitTextToListValues = True and add a check in the DBComboBoxEh.OnExit event.

Code:
procedure TForm2.DBComboBoxEh1Exit(Sender: TObject);
begin
  if DBComboBoxEh1.ItemIndex = -1 then
  begin
    ShowMessage('DBComboBoxEh1 must contain a value from the list.');
  end;
end;

Author:  Luciano_F [ 06 May 2022, 20:22 ]
Post subject:  Re: DbComboboxEh with Search "lsftContainsEh" does not find

My problem is 3 new clients that used a system whose components are from DevExpress
the customer has gotten used to it and wants you to do something similar.

These Damn DevExpress Components are read-only and can do search.

The problem is that leaving LimitTextToListValues = False
the Customer has to click the button instead of clicking any part of the text to open the Dropdown List, it's another thing for the customer to write something that is not on the list.
there are several problems leaving LimitTextToListValues = false
and these new customers are on my tail unfortunately.

If the colleague could give a better analysis to be able to do research using "LimitTextToListValues = True"

I would be very grateful

See this attached video.

https://mega.nz/file/Fvh3nYBI#Ecay-20nc ... JI9yFtQlWI

Author:  EhLibSupport [ 06 May 2022, 23:27 ]
Post subject:  Re: DbComboboxEh with Search "lsftContainsEh" does not find

Quote:
the customer has gotten used to it and wants you to do something similar.

DBComboBoxEh looks similar but not identical. Or you need identical?

Quote:
the Customer has to click the button instead of clicking any part of the text to open the Dropdown List, it's another thing for the customer to write something that is not on the list.

You can use OnDropDown, OnCloseUp to remove/restore LimitTextToListValues state.

Code:
procedure TForm2.DBComboBoxEh1CloseUp(Sender: TObject; Accept: Boolean);
begin
  DBComboBoxEh1.LimitTextToListValues := True;
end;

procedure TForm2.DBComboBoxEh1DropDown(Sender: TObject);
begin
  DBComboBoxEh1.LimitTextToListValues := False;
end;

Author:  Luciano_F [ 07 May 2022, 11:48 ]
Post subject:  Re: DbComboboxEh with Search "lsftContainsEh" does not find

So I'm sorry if I'm being annoying on this issue.
It's because customers keep asking me.

it doesn't have to be the same as DevExpress just have the same functionality.

Hello I just tested this solution using the "OnDropDown" and "OnCloseUp" Events
however That way I should force the Client to always have to open the DropDown List to be able to locate because otherwise
if I give a Setfocus on the combobox and the client tries to type without clicking with the mouse, he won't be able to find it.

if you could improve "LimitTextToListValues" to be able to do any type of search even with "True" it would be great.

Grateful.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/