Home Checkbox Into Grid.mvc
Reply: 0

Checkbox Into Grid.mvc

user2076889
1#
user2076889 Published in 2018-01-12 13:10:57Z

this is a grid mvc with column checkbox and column save. When the user click save it is possible take value from checkbox column? In this code ther's the set of checkbox from model and render from "o.Confirmation". I want to save the value (checked or unchecked) from page. It is possible use the clickfunction() Javascript for the checkbox? Thank you!!!

 @Html.Grid(Model).Columns(columns =>
{
    columns.Add(m => m.A).Titled("A").SetWidth(50);
    columns.Add(m => m.B).Titled("B").SetWidth(70);
    columns.Add(m => m.C).Titled("C").SetWidth(90);
    columns.Add(m => m.D).Titled("D").SetWidth(90);
    columns.Add(m => m.Confirmation).Titled("E?").Encoded(false).Sanitized(false).SetWidth(30).RenderValueAs(o => Html.CheckBox("checked",o.Confirmation));

    columns.Add().Encoded(false).Sanitized(false).SetWidth(25).RenderValueAs(
            @<td style="font-size:large">
            <div>  @Html.ActionLink("Save", "SaveConfirmation", new {id = item.A,confirmation=item.Confirmation})  </div>
            </td>);
}).WithPaging(50);
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.309923 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO