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. Image for the cookie policy date
close icon

Grid isn't working ( syncfusion integrated in an existing MVC5 project 'NET4.5.1')

I integrated Syncfusion ASP.NET MVC (  in an existing MVC5 (.net 4.5.1) project
i used the Assemblies version "13.1451.0.21 " of Syncfusion 

i'm calling a Grind in my view, but each time an exception is triggered : 

An exception of type 'System.NullReferenceException' occurred in Syncfusion.EJ.dll but was not handled in user code
Additional information: Object reference not set to an instance of an object. 

Here my VIEW code : 

            .Datasource((IEnumerable)Model) // i tested with ViewBag.datasource ( same exception )
        .Columns(col =>
             col.Field("Marque").HeaderText("Marque").Width(80).Add(); //The EXCEPTION occurs  in this line

my Controller code contain this in an ActionResult method : 

            var vehicule = db.Vehicule.Include(v => v.Designation); // This returns a list of Objects of type
            return View(vehicule.ToList());

// i tried this too ( and it still not working )
            var v1 = new Vehicule() {Marque = "test"};
            List<Vehicule> vList = new List<Vehicule>();
            vdd.Add(vList );
            ViewBag.datasource = vList.ToList();

May the problem is my way of integrating the Syncfution to my existing project ?

My method :

I created a new Syncfusion MVC5 project (// The Syncfusion use the .NET 4.5 & my project use the .NET 4.5.1)
and then i copied everything related to syncfusion to my Web.Config and i changed  Vestion=13.1450.0.21 to 13.1451.0.21
ex. <add assembly="Syncfusion.EJ, Version=13.1451.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" />

i changed my Layout page & i copied the content & the script

i'm not sure about this part that i add in my web.config file

    <validation validateIntegratedModeConfiguration="false" />
      <remove name="FormsAuthenticationModule" />
      <remove name="MvcResourceHandler" />
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
      <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
      <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
      <add verb="*" path="captimage.axd" name="syncfusion_generatetools" type="Syncfusion.JavaScript.ImageHandler, Syncfusion.EJ, Version=13.1451.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" />
      <remove name="OPTIONSVerbHandler" />
      <remove name="TRACEVerbHandler" />
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />

3 Replies

AS Alan Sangeeth S Syncfusion Team April 17, 2015 12:14 PM UTC

Hi Djamel,
Thanks for using Syncfusion products.
Please refer the following kb to resolve the issue “Null reference exception”
Please let us know if you have any queries.
Alan Sangeeth S

DE Djamel eddine MACHOUK April 18, 2015 07:46 PM UTC

i use this in my web.config File, and now the solution is wroking 

    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <assemblyIdentity name="Syncfusion.EJ" publicKeyToken="3d67ed1f87d44c89"/>
        <bindingRedirect oldVersion="13.1450.0.21" newVersion="13.1451.0.21"/>

Thank you (y).

AS Alan Sangeeth S Syncfusion Team April 20, 2015 05:58 AM UTC

Hi Djamel,
Thanks for the update.
We are happy to hear that your issue has been resolved.
Please let us know if you need any further assistance. We are happy to assist you.
Alan Sangeeth S

Live Chat Icon For mobile
Up arrow icon