ListBoxControl -> how to filter for multiple values?

Stimulsoft Reports.NET discussion
Post Reply
jmmv
Posts: 10
Joined: Mon Feb 13, 2012 5:00 am

ListBoxControl -> how to filter for multiple values?

Post 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

jmmv
Posts: 10
Joined: Mon Feb 13, 2012 5:00 am

ListBoxControl -> how to filter for multiple values?

Post 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...
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

ListBoxControl -> how to filter for multiple values?

Post 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.
jmmv
Posts: 10
Joined: Mon Feb 13, 2012 5:00 am

ListBoxControl -> how to filter for multiple values?

Post 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!
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

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

Post by HighAley »

Hello.

We are always glad to help you.

Thank you.
Post Reply