@(Html.EJ().Grid<SampleApp.Models.OrdersView>("FlatGrid") .Datasource((IEnumerable<object>)ViewBag.datasource) .AllowPaging() .AllowScrolling() .EnableAltRow() .EnableResponsiveRow() .EnableHeaderHover(true) .AllowTextWrap() .PageSettings(page => { page.PageSize(4); }) --------------------- .EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.Dialog); }) .Columns(col => { col.Field("EmployeeID").HeaderText("Employee ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(100).Add(); col.Field("OrderID").HeaderText("Order ID").Width(100).Add(); col.Field("ShipCity").HeaderText("Ship City").Width(100).Add(); col.Field("OrderDate").HeaderText("Order Date").TextAlign(TextAlign.Right).Width(100).Format("{0:MM/dd/yyyy}").Add(); col.Field("ShipCountry").Width(100).HeaderText("Ship Country").Add(); }) )
|
Sample : http://www.syncfusion.com/downloads/support/forum/122076/ze/SampleApp-699053330
Regards,
Prasanna Kumar N.S.V
Hi Manish,
Query : “Does it required to set @Html.EJ().ScriptManager() on each page where the grid is?”
The main reason for referring the ScriptManager in _Layout file is that, it can be referred as common by all the View files present within your application. When we rendering the Grid in partial view using ajax the ScriptManager will not referred for the partial view. So, we need to manually include the scriptmanager for each partial view.
Kindly let me know whether you are having more number of partial view in your application if yes please explain the scenario of how you are using the partial view. So that we can provide you the appropriate solution.
Regards,
Prasanna Kumar N.S.V
<div id="main" style="display:none"> <script type="text/javascript"> $.ajax ({ url: "/Home/Productpartial", type: 'GET', success: function (data) { $("#main").html(data); $("#main").css('display', 'block'); var grid = $("#FlatGrid").ejGrid("instance"); grid._refreshScroller({requestType:'refresh'}); } }); |