This project is read-only.

problems with editable grid

Apr 2, 2014 at 5:40 PM
Edited Apr 2, 2014 at 6:15 PM
Hi, I want to create an editable gridview,

when I click the edit button I send the information of the columns for actionresult,
I want to get changed in the dropdown "sexo".
example code:

                 columns.Add(c => c.Sexo)
.RenderValueAs(c => Html.DropDownList("sexo", items, c.Sexo)).Titled("Sexo");
        .RenderValueAs(c =>
                @Html.ActionLink("Edit", "gridEdit", "Home", new {@Sexo = @Sexo}, null)
public ActionResult gridEdit(object Sexo)
    { ...
thank's for your atencion
Apr 5, 2014 at 8:55 AM

You need to solve the problem by creating an custom javascript code.

First, Attach an dropdown change event:
Then you can send an ajax request to update the field:
    $("select").on("change" , function(){
              $.post( /*url to gridEdit url */, $(this).val());