We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid binding error - CS1061: 'Syncfusion.JavaScript.GridPropertiesBuilder<object>' does not contain a definition for 'DataSource'

Thread ID:

Created:

Updated:

Platform:

Replies:

123969 May 4,2016 05:10 AM May 6,2016 08:37 AM ASP.NET MVC 3
loading
Tags: Grid
Tom Frajer
Asked On May 4, 2016 05:10 AM

I created new MVC 5 project folowing steps here: http://help.syncfusion.com/aspnetmvc/getting-started#mvc-5-application (except that a choose all the available syncfusion components)
At first I tried "Date Picker demo" and it wos working OK.

Next I tried to follow this guide: http://help.syncfusion.com/aspnetmvc/grid/getting-started#create-your-first-grid-in-mvc
Result was OK - I was able to run it and see grid with header without any records in it. Perfect.

Next step was to add some data binding: http://help.syncfusion.com/aspnetmvc/grid/getting-started#data-binding
I pasted the code, but unfortunately, I got this error: CS1061: 'Syncfusion.JavaScript.GridPropertiesBuilder<object>' does not contain a definition for 'DataSource' and no extension method 'DataSource' accepting a first argument of type 'Syncfusion.JavaScript.GridPropertiesBuilder<object>' could be found (are you missing a using directive or an assembly reference?)

I know this is newbie problem, but Im new to this :)
I tried to find solution on your forum and found this thread: http://www.syncfusion.com/forums/118667/Cannot-DataBind-a-Grid
So I checked .JS references, and it seems I have them all in place:

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - My ASP.NET Application</title>
    @Styles.Render("~/Content/css")
   @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/modernizr")
   <link rel='nofollow' href="@Url.Content("~/Content/ej/web/Default-theme/ej.widgets.all.min.css")" rel="stylesheet"/>
   <script src="@Url.Content("~/Scripts/jquery-2.1.4.min.js")"></script>
    <script src="@Url.Content("~/Scripts/jsrender.min.js")"></script>
    <script src="@Url.Content("~/Scripts/jquery.easing.1.3.min.js")"></script>   
    <script src="@Url.Content("~/Scripts/ej/ej.web.all.min.js")"></script>
    <script src="@Url.Content("~/Scripts/ej/ej.unobtrusive.min.js")"></script>
</head> 


My complete index.cshtml is as follows:

@{
    ViewBag.Title = "Home Page";
}

<br />

@(Html.EJ().Grid<object>("FlatGrid")
        
        .DataSource(d => d.URL("http://mvc.syncfusion.com/UGService/api/Orders").CrossDomain(true).Offline(true)).Columns(col =>

    {

        col.Field("OrderID").HeaderText("Order ID").TextAlign(TextAlign.Right).Width(75).Add();

        col.Field("CustomerID").HeaderText("Customer ID").Width(80).Add();

        col.Field("ShipName").HeaderText("Ship Name").Width(100).Add();

        col.Field("ShipCity").HeaderText("Ship City").Width(100).Add();

        col.Field("Freight").Format("{0:c3}").HeaderText("Freight").Width(80).TextAlign(TextAlign.Right).Add();

    })

)

Attachment: Ticking_3f7c33c3.7z

Tom Frajer
Replied On May 4, 2016 09:56 AM

Okay, I found solution to my problem.

@(Html.EJ().Grid<object>("FlatGrid")
.DataSource(d => d.URL("http://mvc.syncfusion.com/UGService/api/Orders").CrossDomain(true).Offline(true)).Columns(col =>

You should check this tutorial as I just copy-pasted it and there is upper case S on DataSource that was causing the error.

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On May 5, 2016 02:16 AM

Hi Tom 

Thanks for contacting Syncfusion Support. We are sorry for the inconvenience. 

We will modify Datasource API of Grid and refresh the following online Getting-started document shortly. 


Regards, 
Seeni Sakthi Kumar S. 


Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On May 6, 2016 08:37 AM

Hi Tom, 

We have modified the Datasource API of Grid and refreshed the following online Getting-started document. 

 
Regards, 
Seeni Sakthi Kumar S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;