BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
<input type="text" id="txtbox"/>
@(Html.EJ().Grid<MvcApplication17.OrdersView>("FlatGrid") .Datasource((IEnumerable<object>)ViewBag.datasource) .AllowScrolling() .AllowPaging() /*Paging Enabled*/ .Columns(col => { col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(75).Add(); col.Field("CustomerID").HeaderText("Customer ID").Width(80).Add(); col.Field("EmployeeID").HeaderText("Employee ID").TextAlign(TextAlign.Right).Width(75).Add(); col.Field("Freight").HeaderText("Freight").TextAlign(TextAlign.Right).Width(75).Format("{0:C}").Add(); col.Field("OrderDate").HeaderText("Order Date").TextAlign(TextAlign.Right).Width(80).Format("{0:MM/dd/yyyy}").Add(); col.Field("ShipCity").HeaderText("Ship City").Width(110).Add(); }) .ClientSideEvents(eve=> eve.RowSelected("rowselected")) )
|
<script> function rowselected(args) { var index= this.selectedRowsIndexes; //you can get the selected row index values var selectedval = this.getSelectedRecords()[0].OrderID; //get the selected records values $("#txtbox").val(selectedval); } |