Page 1 of 1

ListBoxControl -> how to filter for multiple values?

Posted: Wed Jun 27, 2012 3:07 am
by jmmv
I have a form where the user can choose some elements from a listbox. The elements are visible and selectable (multi selection).

In a databand, I want now to filter for those selected elements. So I go under "Filter" and insert following expression:
Requirements.Code == ListBoxControl1.SelectedItem

Now this gives me only the first selected item of the listbox, but I want that all the selected Items.

So what I need is something that gives me in the filter expression, all the selected items of the listbox.

Many thanks!

Edit: Here some screenshots to better understand.
The listbox to select my items:
Image

The filter function of the databand (where I would like to have all selected, and not just the first):
Image


ListBoxControl -> how to filter for multiple values?

Posted: Thu Jun 28, 2012 7:48 am
by jmmv
I tried to solve this problem by filling a new variable with the content of the listbox, unfortunately it didn't worked aswell.
I'm running out of ideas...

ListBoxControl -> how to filter for multiple values?

Posted: Fri Jun 29, 2012 6:32 am
by Alex K.
Hello,

In this case, you can use the CheckedListBoxControl component and the following expression in filter:
CheckedListBoxControl1.Control.CheckedItems.Contains(Requirements.Code)

Thank you.

ListBoxControl -> how to filter for multiple values?

Posted: Fri Jun 29, 2012 7:50 am
by jmmv
Aleksey wrote:Hello,

In this case, you can use the CheckedListBoxControl component and the following expression in filter:
CheckedListBoxControl1.Control.CheckedItems.Contains(Requirements.Code)

Thank you.
that worked perfectly, many thanks!

Re: ListBoxControl -> how to filter for multiple values?

Posted: Sat Jun 30, 2012 12:09 pm
by HighAley
Hello.

We are always glad to help you.

Thank you.