[RESOLVED]How to pass selected rows data of flexi grid to controller.


we have a flexi grid in view,need to pass selected rows(check box selected rows) data(it includes two columns data of selected row) to controller.how to achieve this in MVC,



In your razor view, initiate a form. Then, use a @for loop to write out a table. In the table, each row should represent a view model with a ‘Selected’ property. Then, use @Html.CheckBoxFor(m => Model[i].Selected). When the ‘submit’ button is pressed, the
models will bind back into your controller’s Post action, and you can handle the incoming data appropriately.

@for( var i = 0; i < Model.Count; i++) 
    <td>@Html.CheckBoxFor(m => Model[i].Selected)</td>
    <td>@Html.Name(m => Model[i].Name)</td>

Hi Balu,

For this scenario, you need get the data manually. I suggest that you could use AJAX to submit the data. (read the selected row’s data first)

Best Regards


Leave a Reply