I'm developing a site with ASP.NET MVC and Razor, I have one table with a few columns in one of my pages.
I have in this table a State column which has a CheckBox and another column containing a DropDownList with some options.
I would like that when I change the value of the DropDownList, the value of the CheckBox was also changed to checked, since I use the checked lines to send to the controller.
I have tried using the parent (JQuery) element, but I get a response that parents do not support.
Could someone help?
VIEW
<table class="table table-condensed table-bordered table-striped table-hover table-reflow">
<thead class="thead-inverse">
<tr>
<th class="text-center bs-checkbox"><input type="checkbox" /></th>
<th class="text-center col-md-5">Emitente</th>
<th class="text-center">Manifestação</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.listaManifestacao)
{
<tr id="@item.Id">
<td class="text-center">
<div class="bs-checkbox"><input type="checkbox" /></div>
</td>
<td class="text-center">@item.Emitente</td>
<td class="text-center">
@Html.DropDownListFor(m => item.CodigoEvento, new SelectList(Model.listaOpcoesManifestacao, "Id", "Descricao", item.CodigoEvento), new { @class = "form-control", onchange = "CheckState(this);" })
</td>
</tr>
}
</tbody>
</table>