Get selected row on code side

Nov 2, 2013 at 1:17 PM
Hi

I want to know how i can get the selcted row on code side.
I choose a property from my model, added it as name (Named) on the Grid. But the property is not set.
Coordinator
Nov 6, 2013 at 2:00 AM
Hi,

Method onRowSelect fires only on client side. if you want to pass selected row to the server:
  1. you can use ajax call. See online demo code for details: https://gridmvc.codeplex.com/SourceControl/latest
  2. Setup hidden field in the form, like
<form action="path/to/controller/action">
        <input type="hidden" id="field" name="field" />
        <button type="submit">Send!</button>
</form>

<script>
     $(function () {
        pageGrids.ordersGrid.onRowSelect(function (e) {
              $("#field").val(e.row.OrderID);
        });
    });
</script>