CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

MultipleSelection Behaviour

by stuartcf » 21 Feb 2015 12:42

Hi Team!

Here is an example of a problem I am experiencing when using Selects with MultipleSelection = True

I need to populate a multi-select box and pre-set certain items as selected in code BEFORE any user interaction. Here is an example:

with CustomiseSelect.SelectBoxList[0].Items.Add do
begin
Caption := MyQuery1.FieldByName('itemname').AsString;
Value := MyQuery1.FieldByName('itemno').AsString;
Selected := True;
Disabled := False;
end;

The problems is that the line "Selected := True;" just doesn't seem to work. I can read this property OK after user interaction to assess what options they have selected, but I can find no way to pre-set the selections and display it to the user to begin with.

Are my expectations of this components behaviour correct, or should I be using a different method?

Many thanks

Stuart.
stuartcf
 
Posts: 6
Joined: 28 Dec 2014 12:16

by stuartcf » 22 Feb 2015 12:01

Just an update - I have found that this problem only occurs if the code is within the form's OnCreate event. I have dropped it out of there (via a timer), and I find the multi-select behaviour is as I would have expected. Thanks.
stuartcf
 
Posts: 6
Joined: 28 Dec 2014 12:16

by Alexander Bulei » 23 Feb 2015 14:26

Hi Stuart,

You are right, it's a bug.
Fixed in next beta release.

Thank you!

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal


Return to JQMSelect

cron

Who is online

Users browsing this forum: No registered users and 2 guests

Contact Us.