title: Is there a way to handle the dynamic change of a dropdown for a single row in a grid-based datawindow?
body: <p>Is there a way to handle the dynamic change of a dropdown for a single row in a grid-based datawindow?</p>
  
  <p>Example:</p>
  
  <pre><code>NAME    LIKABILITY         PURCHASED IN  COLOUR
  (Text)  (DropDown*)        (Text)        (Text)
  Bananas [Good]             Hands         Yellow
          [Bad]
          [Bananas are good]
  
  Apples  [Good]             Bags          Red
          [Bad]
  </code></pre>
  
  <p>Given the above is a grid-based datawindow, where the fields <code>NAME</code>,<code>PURCHASED IN</code> and <code>COLOUR</code> are text fields, where as the <code>LIKABILITY</code> field is a dropdown*.</p>
  
  <p>I say dropdown* because the same visual representation can be created by using a DropDownList (hardcoded within the datawindow element at design time), or a DropDownDW (or DDDW, a select statement that can be based on other elements in the datawindow).</p>
  
  <p>However, there is no way I can get <code>Bananas</code> having it's 3 dropdowns, while Apples has only 2.</p>
  
  <p>If I enter multiple rows of <code>Bananas</code>, then all rows have 3 dropdowns, but as soon as I add an Apples row, all dropdowns revert to 2 selections.</p>
  
  <p>To attempt to achieve this functionality, I have tried the following options:</p>
  
  <ol>
  <li><p><code>dw_1.Object.likability.values("Good~tG/Bad~tB/Bananas are good~tDRWHO")</code>
  on ue_itemchange when editing NAME. </p>
  
  <p>FAILS: edits all instances of LIKABILITY instead of the current row.</p></li>
  <li><p>Duplicate Dropdowns, having one filtered, one unfiltered selection list per row, visible based on NAME selection.</p>
  
  <p>FAILS: can't set visibility/overlapping columns on grid-based datawindow. <a href="http://pbbraindump.wordpress.com/2008/11/16/the-ol%E2%80%99-hidden-items-in-the-dddw-problem-part-ii/" rel="nofollow noreferrer">(Source)</a></p></li>
  <li><p>Hard-code display value as Database value, or Vice Versa. Have <code>GOOD</code>,<code>BAD</code>,<code>BANANASAREGOOD</code> as the display and database values, and change handling of options from G, B, DRWHO to these new values.</p>
  
  <p>FAILS: 3rd option appears for all rows, still selectable on Apple rows, which is wrong.</p></li>
  <li><p>DDDW retrieve list of options for dropdown. Create a DDDW that uses the value of NAME to determine what selections it should have for the dropdown.</p>
  
  <p>FAILS: edits all instances of the dropdown, not just the current row.</p></li>
  <li><p>DDDW retrieve counter of options available (if B then 3 else 2), then have duplicate dropdown columns that protect/unprotect based on DDDW counter.</p>
  
  <p>FAILS: Can't autoselect dddw value to populate column to cause protect on other two columns, ugly solution in any case.</p></li>
  </ol>
  
  <p>There is now a <strong>bounty</strong> on this question for anyone who can give me a solution that will enable me to edit a dropdown column for a single row on a grid-based datawindow in PB 10.5</p>