Community
Showing results for 
Search instead for 
Do you mean 
Reply

Multiselect ComboBox

Accepted Solution Solved
Copper Contributor
Posts: 42
Country: Germany
Accepted Solution

Multiselect ComboBox

[ Edited ]

act has a pretty cool multiselect ComboBox:

Untitled.png

 

I was wondering if it was possible to use this in my own Windows Forms Plug-Ins.

Googling for "Multiselect Combobox" or "CheckedListBox ComboBox" returned some solutions, but they all are a bit cheesy (e.g. one has to click twice for the first check box to get activated)

 

I tried to place the

  1. Act.UI.Designer.Controls.ComboBox
  2. Act.Shared.Windows.Forms.ActCheckBox
  3. Act.Shared.Windows.Forms.ComponentListComboBox

on my Form but they all work and look like an ordinary ComboBox.

Am I missing some properties or does none of them have the "CheckBox"-Capability?


Accepted Solutions
Solution
Accepted by topic author twolfram
‎09-25-2015 03:20 AM
Employee
Posts: 1,163
Country: USA

Re: Multiselect ComboBox

This one worked for me, you can just drop the .cs file into your solution and it'll add it to the toolbox or you can modify it yourself. If you're gong to use it to write to act you'll need to change the delimeter to a semicolon.

Matthew Wood
Act! SDK Support
Community Moderator

View solution in original post


All Replies
Solution
Accepted by topic author twolfram
‎09-25-2015 03:20 AM
Employee
Posts: 1,163
Country: USA

Re: Multiselect ComboBox

This one worked for me, you can just drop the .cs file into your solution and it'll add it to the toolbox or you can modify it yourself. If you're gong to use it to write to act you'll need to change the delimeter to a semicolon.

Matthew Wood
Act! SDK Support
Community Moderator
Copper Contributor
Posts: 42
Country: Germany

Re: Multiselect ComboBox

Thanks for your reply

 

this is one of the solutions I found myself so far which has the ugly behaviour, that after opening the drop-down, the first click to a checkbox won't check it. so one has to click twice for the first check to occur. the act-checkboxes behave much better.

Nickel Contributor
Posts: 175
Country: USA

Re: Multiselect ComboBox

Since the source is available (I didn't download and look through it), you could probably modify it to get the behavior you want. I know the CheckedListBox has a property called CheckOnClick that when set to True will provide what you are looking for. I've used this before, but not in the context of the control that Matthew provided a link to. I hope this helps out.
Copper Contributor
Posts: 42
Country: Germany

Re: Multiselect ComboBox

Final solution:

Add Reference to Act.UI.Picklist

Place unboundPicklist Control to the Form

Set the unboundPicklist's PickList property to an act! PicklList

 

As I was using a "default" ComboBox für displaying PickList.Items this is now just what I wanted.

Copper Contributor
Posts: 123
Country: Canada

Re: Multiselect ComboBox

Would you be so kind to elaborate on how you used the unbound picklist?
Copper Contributor
Posts: 42
Country: Germany

Re: Multiselect ComboBox

[ Edited ]

It's been a while, I hope I remember all steps I've taken.

 

Create your ACT-Project (WinForms, not WPF)

Add a reference to Act.UI.PickList.dll to your project.

Add the controls of the Act.UI.PickList.dll to your toolbox.

I used the UnboundPicklist control on my form but one might want to try the others as well.

In the form's constructor (or Window_Loaded event) put the following line (C#) to bind it to a list in ACT:

unboundPicklist1.PickList = Act.UI.ActApplication.Instance.ActFramework.PickLists.GetPickListByName("PickListName");

 I think it would also be possible to bind it to any kind of IEnumerable-List, but haven't tryed this.

Copper Contributor
Posts: 123
Country: Canada

Re: Multiselect ComboBox

Ok thank you very much. I appreciate your response!

I'm a rookie when it comes to programming but was able to create a custom sub-entity and form to add new records but my only issue was that one of the fields is a multiselect Combobox and it has been giving me a hard time.

I did bind the unbound picklist's picklist property to my act picklist but for some reason I wasn't able to get the control to show up. I'm sure I am just missing something fundamental.

I'll give it another shot. Thanks again!
-Eric
Copper Contributor
Posts: 123
Country: Canada

Re: Multiselect ComboBox

I think where I went wrong was I didn't add the controls of Act.UI.PickList.dll to the visual studio toolbox and I was trying to manually add it within the form.

Thank you so much this really helped me out!
-Eric
Copper Contributor
Posts: 123
Country: Canada

Re: Multiselect ComboBox

[ Edited ]

So I have hit another block and if you feel like helping this rookie out this would be great.


I was able to add the ACT picklist control to my form and the values are read in properly (ex: the field contains three years 1998;1999;2000 and the picklist shows up with each year checked as expected)

My issue is that when I make a change through the picklist control by checking another year say 2001, I will see it being added to the text of the control so 1998;1999;2000;2001 but when I click ok on my form the value doesn't show up in my datagridview and is not changed in the DB.

Here is the code I'm using in the forms OnLoad event:

Act.Framework.PickLists.PickList pickList = this.framework.PickLists.GetPickList("Refund Tax Years");

refundTaxYrsUnboundPickList.PickList = pickList;

this.refundTaxYrsUnboundPickList.DataBindings.Add("Text", this.bindingSource, "REFUND_TaxYr", false);

 I can't seem to figure out why this won't work as all of my other fields will update correctly.

Any thoughts?