Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Trying to create dependency fields on a form with two drop down lists View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
spengelly - 11/8/2013 4:46:42 PM
   
Trying to create dependency fields on a form with two drop down lists
I am trying to create dependency fields on a form with two drop down lists

The second drop down list data is dependent on the first selection. I am having trouble passing the value of the first selection in the datasource field in the Editing Control Settings. Anyone have an idea of the proper syntax for the datasource for the second field? I tried something like this

SELECT PropertyID, PropertyName
FROM Property
WHERE PropertyRegion = '{%Region%}'

but the Region value doesn't resolve.

Thanks.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/12/2013 6:16:22 AM
   
RE:Trying to create dependency fields on a form with two drop down lists
Hello,

I am afraid but it does not work this way. It is not supported to use macros on the SQL query level of the drop down list form control. This dependency has to be ensured in the form control code behind.
You will have to create a custom form control, that will consist of two drop down lists and on the selection change event of the first one, you will load the values to the second one.

Best regards,
Juraj Ondrus