This project is read-only.

Custom dropdown list as filter

Dec 16, 2011 at 10:03 AM


I have another question: 

Is it possible to create a custom dropdown list, based on a custom sql query, to filter the table data with an additional "where" clause?


best regards, 

Søren T


Dec 16, 2011 at 12:45 PM

Hi Søren,

Definitely. In the latest build (here on codeplex > downloads > latest build) you can you something like this:

      <field title="selfRefId" sourceField="selfRefId" umbracoDataType="Dewd Dropdown">
        <listControlDataSource includeEmpty="true" emptyValue="0">
          <sql><![CDATA[SELECT id, nvarcharField FROM dewdTypeTest WHERE id=@id]]></sql>
          <parameter name="@id" type="HttpContext" key="Request[id]" />

The parameter can be changed to point to a custom type, which returns the value or it can use one of the default parameter values as shown here:

<view name="Todays entries">
  <sql>SELECT * FROM umbracoLog WHERE CAST(Datestamp AS date)=@today</sql>
  <parameter name="@today" get="today" />

Hope this helps. I'll get back to your other question later, shouldn't be a problem either.


Dec 16, 2011 at 1:23 PM

Hi SuneBoegh

Thanks alot! Great news!:)

br, Søren T