<p>I have a partial that renders a select box using the following method:</p>

<pre><code>&lt;%= collection_select 'type', 'id', @types, "id", "name", 
  {:prompt =&gt; true}, 
  {:onchange =&gt; 
              remote_function(
              :loading =&gt; "Form.Element.disable('go_button')",
              :url =&gt; '/sfc/criteria/services', 
              :with =&gt; "'type_id=' + encodeURIComponent(value) + '&amp;use_wizard=#{use_wizard}'"),
    :class =&gt; "hosp_select_buttons"
} %&gt;
</code></pre>

<p>This partial gets used 2 times on every page, but at one point I need to get the value of the first select box. Using:</p>

<pre><code>$('type_id')
</code></pre>

<p>returns the second select box. Is there a way to find the first one easily? Should I fix this using javascript or by redoing my partial?</p>

<p>Note: the dropdowns do get rendered in separate forms.</p>

As per your "UPDATE", creating a custom
```
DataGridViewCell
```
is the way this is done. I've done it, and it doesn't require that much modification from the example code available from the MSDN. In my case, I needed a bunch of custom editing controls, so I ended up inheriting from
```
DataGridViewTextBoxCell
```
and
```
DataGridViewColumn
```
. I inserted into my class (the one inherited from
```
DataGridViewTextBoxCell
```
) a new custom control which implemented
```
IDataGridViewEditingControl
```
, and it all just worked.
I suppose that in your case, you could write a
```
PanelDataGridViewCell
```
which would contain a control
```
MyPanelControl
```
which would inherit from Panel and implement
```
IDataGridViewEditingControl
```
.