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.

Existing Solution

Thread ID:

Created:

Updated:

Platform:

Replies:

110951 Sep 2,2013 03:12 AM Sep 5,2013 08:25 AM ASP.NET MVC (Classic) 4
loading
Tags: Grid
Manolis
Asked On September 2, 2013 03:12 AM

I would like to know how to use the Syncfusion ASP.NET MVC controls in an existing solution. In order to use the Grid control I referenced the Syncfusion.Grid.Mvc.dll in my solution and I used code from Grid -> Getting Started section but i had the following error message.

'System.Web.Mvc.HtmlHelper<dynamic>' does not contain a definition for 'Syncfusion' and no extension method 'Syncfusion' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<dynamic>' could be found (are you missing a using directive or an assembly reference?)

My C# code is the code below:

<div style="width:100%" class="sample-panel-margin">
    @(Html.Syncfusion().Grid<MvcApplication4.Models.Student>("Simple_Grid", "GridModel", column =>
        {
            column.Add(p => p.StudentID).HeaderText("Student ID").Width(100);
            column.Add(p => p.Name).HeaderText("Name").Width(20);
            column.Add(p => p.Surname).HeaderText("Surname").Width(20);
            column.Add(P => P.DateOfBirth).HeaderText("Date of birth").Format("{OrderDate:MM/dd/yyy}");
            column.Add(p => p.Maried).HeaderText("Maried").Format("{OrderDate:MM/dd/yyy}");
            column.Add(p => p.NumberOfChildren).HeaderText("Number of children").Format("{OrderDate:MM/dd/yyy}");
        }))
</div>

Thanks in advance.

Ajith R [Syncfusion]
Replied On September 3, 2013 02:42 AM

Hi Manolis,

 

Thanks for using Syncfusion products.

 

Query : Reference based error in Grid MVC

 

We suspect that you have missed some Grid dependent references in your existing solution. We suggest you to add the Grid dependent references in your solution to resolve the issue. Please refer our online documentation link below to know the details about the references in the Grid.

 

http://help.syncfusion.com/ug/asp.net%20mvc/grid/default.htm#!documents/howdoiaddessentialgr1.htm

 

http://help.syncfusion.com/ug/asp.net%20mvc/grid/default.htm#!documents/213dll.htm

 

Please refer the below link to download the sample.

 

Sample.zip

 

Please let us know if you have any concerns.

 

Regards,

 

Ajith R

 


Manolis
Replied On September 3, 2013 07:15 AM

For some reason it does not work. First of all it does not recognize the Syncfusion object. For example in the following lines that I have to define in the header part of the page, the Syncfusion is not recognized:

@{Html.Syncfusion().StyleManager() 
        .Register(stylesheets =>
            {
             stylesheets.Add(ComponentType.Grid);
            }).Render();}

and the error message is the following:

System.Web.Mvc.HtmlHelper<dynamic>' does not contain a definition for 'Syncfusion' and no extension method 'Syncfusion' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<dynamic>' could be found (are you missing a using directive or an assembly reference?)

In the code above, the ComponentType is not recognized as well.

I also tried to run the sample and the following error appeared on the screen. 

Assembly 'Syncfusion.Grid.Mvc, Version=11.2440.0.25, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89' uses 'System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

Is there something else that I have to do in order to make it work?

I use Visual Studio Professional 2012 and .NET Framework v4.5


Manolis
Replied On September 4, 2013 01:43 AM

It is ok. I just found a way to automatically convert an existing project to an Syncfusion MVC project. I right clicked on the prject name and selected the command Convert to Syncfusion MVC Application from the Syncfusion VS Extensions submenu.

Ajith R [Syncfusion]
Replied On September 5, 2013 08:25 AM

Hi Manolis,

 

Thanks for your update.

 

Could you please let us know whether your reported issue has been resolved or if not please provide more information regarding the issue 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.

 

Please let us know if you need any further assistance.

 

Regards,

 

Ajith 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.

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.

;