[WebMethod]
public virtual GridWebService Index(WebServiceParams webParams)
{
IEnumerable<License> licenseList = GetItems().ToList();
return licenseList.GridWebServiceAction<License>(webParams);
}
Hi Jeremy,
Thanks for using Syncfusion products.
We suspect that you have used the code IEnumerable<License>
in your cshtml page. Please remove the specified code from your cshtml page to
avoid your reported issue.
Please refer our online documentation
link for further reference.
http://help.syncfusion.com/ug/asp.net%20mvc/grid/default.htm#!documents/webservicedatabindin.htm
Please let us know if you have need further
assistance.
Regards,
P.SarathKumar.
Hi Jeremy,
We regret for the inconvenience caused.
We suggest you to refer the below Web
service asmx code snippets, cshtml page code snippets for your reference.
[Orders.asmx.cs]
namespace
Syncfusion.Mvc.Grid.Models
{
using
System.ComponentModel;
using
System.Linq;
using
System.Web.Script.Services;
using
System.Web.Services;
using
MVCSampleBrowser.Models;
using
Syncfusion.Mvc.Grid;
using
System.Collections;
using
System.Xml.Serialization;
using
System.Runtime.Serialization;
using
System.Collections.Generic;
using
System.ServiceModel.Web;
[WebService(Namespace
= "http://tempuri.org/")]
[WebServiceBinding(ConformsTo
= WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
[ScriptService]
public
class OrdersAsmx : System.Web.Services.WebService
{
[WebMethod]
public
GridWebService RenderOrders(WebServiceParams webParams)
{
IEnumerable
data = new NorthwindDataContext().OrdersViews.Take(100).ToList();
return
data.GridWebServiceAction<OrdersView>(webParams);
}
}
}
[Asmx.cshtml]
@(Html.Syncfusion().Grid<OrdersView>("Grid1")
.Caption("Orders")
.WebService(Url.Content("~/Models/Orders.asmx/RenderOrders"))
.Column(column
=>
{
column.Add(p
=> p.OrderID).HeaderText("Order ID").TextAlign(TextAlignment.Right).Width(100);
column.Add(p
=> p.EmployeeID).HeaderText("Employee
ID").TextAlign(TextAlignment.Right).Width(115);
column.Add(p
=> p.ShipAddress).HeaderText("Ship Address");
column.Add(p
=> p.ShipCity).HeaderText("Ship City").Width(150);
column.Add(p
=> p.ShipCountry).HeaderText("Ship Country").Width(170);
})
.EnablePaging().PageSettings(p
=> p.PageCount(5))
.EnableSorting()
.EnableGrouping().EnableFiltering()
.AutoFormat(Skins.Marble))
Please let us know if you need further
assistance.
Regards,
P.Sarathkumar.
Hi Jeremy,
We are sorry for inconvenience caused. We are unable to reproduce the issue. We have prepared a simple working sample and the same can be downloaded from the following links.
Could you please try the below sample and get back to us whether you are able to reproduce the issue? If not, could you please give more information or by reproducing the issue in the above sample so that we could sort out the issue and provide you with solution. The information provided would be of great help in resolving the issue.
Sample :
Please let us know if you need any further assistance.
Regards,
Rakesh D