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

After NuGet install, compilation error

Thread ID:

Created:

Updated:

Platform:

Replies:

120070 Aug 21,2015 03:24 PM UTC Aug 31,2015 01:04 PM UTC ASP.NET MVC 6
loading
Tags: DataManager
David Elies
Asked On August 21, 2015 03:24 PM UTC

After installing syncfusion MVC5 4.5, I get a compilation error when trying to add a grid control.

Compiler Error Message: CS1061: 'Syncfusion.MVC.EJ.EssentialJavaScriptFor<dynamic>' does not contain a definition for 'DataManager' and no extension method 'DataManager' accepting a first argument of type 'Syncfusion.MVC.EJ.EssentialJavaScriptFor<dynamic>' could be found (are you missing a using directive or an assembly reference?)

It seems that something necessary was not installed by the nuget package manager, or I needed to install another package.  What is missing?

Kanimozhi Pandian [Syncfusion]
Replied On August 24, 2015 12:33 PM UTC

Hi David,

Thanks for using Syncfusion products.
We are unable to reproduce the reported issue with our Syncfusion NuGet packages. We suspect that the Syncfusion assembly version conflicting in your project. So please remove the old Syncfusion references manually before installing the Syncfusion NuGet packages.

Could you please follow the below steps to remove the old references?

1.     Remove the old version Syncfusion dlls from the project. Please refer below screenshot for more information.

      
2.     Remove the Syncfusion dll entries from Web.config file (if referred). Please refer below screenshot for more information.



3.     Clear the bin and obj folders.
4.     Now install the latest NuGet package and Build the project.

Please let me know if you have any further queries.

Thanks,
Kanimozhi.K.P.

David Elies
Replied On August 27, 2015 05:38 PM UTC

Okay, I installed the less-intuitive NuGet package that contains the latest version.  Now I am getting a console error when using the DataManager:

ej.DataManager : Unsupported htmlElement : div

Jim Woods
Replied On August 28, 2015 03:21 AM UTC

I am getting this same error.

I recently installed SyncFusion.AspNet.Mvc5, Version 13.2.0.34, via NuGet.

Please advise.

Isuriya Rajan [Syncfusion]
Replied On August 28, 2015 09:03 AM UTC

Hi David,

You have used wrong data binding for the Grid. Grid can bind only JSON data or table. 

If you face any difficulties still, please let us know if you are using DIV element for Grid binding or want to bind any other data.

<script id="_table1" type="text/template">

    //table data

        <thead>

            <tr>

                <th>Laptop</th>

               <th>Model</th>

                <th>Price</th>  

            </tr>

        </thead>

        <tbody>

            <tr>

                <td>Dell Vostro</td>

                <td>2520</td>

                <td>638.56</td>

                <td>Windows 8</td>

                <td>4GB</td>

                <td>15.6</td>

            </tr>

        </tbody>

</table>

</script>


@(Html.EJ().Grid<object>("Grid")            

           //table binding

          .Datasource(ds => { ds.Table("#_table1"); })

          .Columns(col =>

          {

              col.Field("Laptop").HeaderText("Laptop").Width(130).Add();

              col.Field("Model").HeaderText("Model").Width(130).Add();

               . . . . . 

          })

          

)


We have created a sample and the same can be downloaded from the following location:

 http://www.syncfusion.com/downloads/support/directtrac/142423/ze/New_Compressed_(zipped)_Folder168204619

Please refer to the below documentation link for how we can use table binding in grid,

Tablebinding

Please let us know if you have any queries.

Regards ,
Isuriya R


Jim Woods
Replied On August 28, 2015 05:01 PM UTC

But I am not doing any table binding.  I am calling an OData 4 Rest Service.  This is my code:

 @(Html.EJ().DataManager("TestURL").URL("https://MyOdata4RestService")
          .CrossDomain(true)
          )

    @(Html.EJ().Grid<object>("Grid")
     .AllowPaging()
        .AllowSorting()
                    .DataManagerID("TestURL")
                            .Query("ej.Query().select(['ApplicationID']).take(5)")

                .ToolbarSettings(toolBar => toolBar.ShowToolbar().ToolbarItems(items =>
                    {
                        items.AddTool(ToolBarItems.ExcelExport);
                        items.AddTool(ToolBarItems.WordExport);
                        items.AddTool(ToolBarItems.PdfExport);
                    }))
                        .Mappers(map => map.ExportToExcelAction("ExcelAction")
                .ExportToPdfAction("PdfAction").ExportToWordAction("WordAction")
              )

        .Columns(col =>
            {
                col.Field("ApplicationID").HeaderText("Application ID").TextAlign(TextAlign.Right).Add();
                col.Field("Visits").HeaderText("Visits").TextAlign(TextAlign.Right).Add();

            })

         .ClientSideEvents(eve => { eve.Load("load"); })
         .AllowGrouping(true)
         .AllowFiltering()
    )

This error ('Uncaught ej.DataManager : Unsupported htmlElement : div') seems to occur as the result of using a DataManager.
I have also tried:

@(Html.EJ().DataManager("TestURL").URL("https://MyOdata4RestService/?$format=json")
          .CrossDomain(true)
          )
This does not work either.

Isuriya Rajan [Syncfusion]
Replied On August 31, 2015 01:04 PM UTC

Hi Jim,
We sorry to let you know that, we are unable to reproduce the mentioned” getting compilation error” within our sample side .We can run the sample without any compilation error . Could you please check that the assemblies are properly referred in your project?
·         Please provide issue reproducing step video.
·         Otherwise kindly provide the issue reproducible sample to us
 If we misunderstood your query, please provide us clear information regarding your requirements. It will help us to provide the prompt solution.

Regards,
Isuriya R


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

;