Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Can you use a Filter + Datasource + Repeater with a multi-select field? View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
jbubriski-wakefly - 5/26/2010 2:04:23 PM
   
Can you use a Filter + Datasource + Repeater with a multi-select field?
I'm trying to make it so that a document type I have has a multi select field for associating it with multiple categories. Then, I want to be able to filter on those categories using a filter + datasource + repeater.

This works fine with a single select field, but when I change it to multi-select, it stops working. Any ideas? Thanks,

John

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 5/27/2010 3:38:18 AM
   
RE:Can you use a Filter + Datasource + Repeater with a multi-select field?
Hi,

In the filter you need to use format like this (where | is the multiple selection values separator in the DB):

"|" + columnname + "|" LIKE "%|valueX|%"

I hope it will help.

Best regards,
Juraj Ondrus

User avatar
Member
Member
rahat.veraida-gmail - 12/11/2011 5:43:09 PM
   
RE:Can you use a Filter + Datasource + Repeater with a multi-select field?
Hi, will the query work if we want to select "2" or "4" from the value "2|3|4"?
can you give a complete example example using a cmsdatalist or cmsrepeater?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 12/12/2011 1:16:09 AM
   
RE:Can you use a Filter + Datasource + Repeater with a multi-select field?
Hi,

1) You can create a custom function for a transformation which will parse the value in given field and display whatever you want based on the values

2) You can create a custom form control which will store the values in your desired format.

3) Or, in the web part properties you can also use the WHERE condition where you will compose SQL query as usual.

Best regards,
Juraj Ondrus