Jump to content


Photo

NxComboBox with autocomple mode


  • Please log in to reply
12 replies to this topic

#1 PCBleu

PCBleu
  • Members
  • 33 posts

Posted 11 August 2009 - 04:56 PM

Hi,

I have a little problem with NxComboBox.
I want to have an autocomplete CBox, but I dont know how to make it.

I'm using last version of the component on D7.

Regards
Bleu

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 11 August 2009 - 05:23 PM

Hello Bleu,

This option doesn't exist yet, but you may use NxAutoCompletion component (NxAddonsRun.dpk package) and attach auto-completion list to the ComboBox.

More info about NxAutoCompletion components:

http://dn.bergsoft.n...on-tutorial.htm

I hope that this helps.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 PCBleu

PCBleu
  • Members
  • 33 posts

Posted 11 August 2009 - 07:15 PM

Is it a property that you will add for this component

Thanks in advance


#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 11 August 2009 - 08:00 PM

Hello PCBleu,

In future I will add similar property to NxComboBox, but please note that this can take a while.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#5 PCBleu

PCBleu
  • Members
  • 33 posts

Posted 02 October 2009 - 05:52 PM

Hello Again

is there any possibility to have a more precise exemple with NxAutoCompletion and NxComboBox

Thanks in advance

#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 02 October 2009 - 09:30 PM

Hello PCBleu,

I will made one small example tomorow.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#7 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 04 October 2009 - 02:56 AM

Hello PCBleu,

You will need to add similar code:

CODE
procedure TForm1.Button1Click(Sender: TObject);
var
  i: Integer;
begin
  NxAutoCompletion1.Strings.Clear;
  for i := 0 to NxComboBox1.Items.Count - 1 do
  begin
    NxAutoCompletion1.Strings.Add(NxComboBox1.Items[i]);
  end;
  NxAutoCompletion1.Associate := NxComboBox1;
  NxAutoCompletion1.Enabled:= True;
end;


This code will copy a content from NxComboBox and move it to Strings property of NxComboBox.

I hope that this helps smile.gif

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#8 PCBleu

PCBleu
  • Members
  • 33 posts

Posted 28 August 2010 - 11:27 AM

Hello,

New questions about autocomplete, with last version installed
I find new NxComboBox properties such as AutoComplete, AutoCompleteDelay and AutoDropDown...

I did not reach to find a way to use correctly these properties...
I am very interested in using AutoComplete property for DropDown or DropDownList NxComboBox

Thanks for any help or advise


#9 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 28 August 2010 - 10:29 PM

Hello PCBleu,

Try to set AutoComplete to true and then add several items in Items property. When you type item that begins with letters same as in Items property, drop-down string will appear.

AutoDropDown when set to True opens a pop-up list as when you type any letter.

I suggest that you add some dummy items and you will understand all very soon smile.gif

I hope that this helps.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#10 PCBleu

PCBleu
  • Members
  • 33 posts

Posted 29 August 2010 - 04:16 PM

Thanks for your answer

in fact, I just use NxComboBox with "DsDropDownList" Style
and when I type any character, just the first character of an item can change the selection

for example with items like "Alemania, Argentina, Francia..."
and with a DsDropDownList style
when I type "F", this will select "Francia", and if I type "A", it just select "Alemania"
with no effects with further "A" typed

Is there a possibility to correct this problem

Thanks in advance

#11 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 01 September 2010 - 03:50 PM

Hello PcBleu,

This is happening because Style is set to DropDownList. Unfortunately this is how it works.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#12 PCBleu

PCBleu
  • Members
  • 33 posts

Posted 01 September 2010 - 04:21 PM

Thanks for your answer

in fact I use this style, because I want to limit the selection within the items listed in the box

is there a way to limit the text introduced by the user

Regards

#13 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 01 September 2010 - 04:33 PM

Hello,

You may access to OnKeyPress event of the Grid:

CODE
procedure TForm1.NextGrid1KeyPress(Sender: TObject; var Key: Char);
begin
  if gtEdit in NextGrid1.GridState then
  begin
    if Key = '-' then Key := #0;
  end;
end;


This code will disable typing - char.

It is important to use

CODE
  if gtEdit in NextGrid1.GridState then


You may access to the Editor property of Column, or access to the InplaceEdit property of NextGrid too.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users