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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

'IHtmlHelper<dynamic>' does not contain a definition for 'EJ'

Thread ID:





147372 Sep 8,2019 06:38 AM UTC Sep 11,2019 06:49 AM UTC ASP.NET Core - EJ 2 4
Tags: DataGrid
Abaid-ur-Rehman Zulfi
Asked On September 8, 2019 06:38 AM UTC

I wanted to access datagrid dynamically so I can configure it from controller. I researched on forums & found the snippet. Here is sample snippet for button control (I took code from here https://www.syncfusion.com/forums/123170/add-columns-dynamically-from-controller-or-through-script)

@(Html.EJ().Button("ClickMe").Text("Click Me").Type(ButtonType.Button).ClientSideEvents(events => events.Click("click")))

However, Syncfusion.JavaScript namespace can't be found & following errors show up

Error CS0234 The type or namespace name 'JavaScript' does not exist in the namespace 'Syncfusion' (are you missing an assembly reference?)
Error CS1061 'IHtmlHelper<JavaScript.Models.GridProperties>' does not contain a definition for 'EJ' and no accessible extension method 'EJ' accepting a first argument of type 'IHtmlHelper<JavaScript.Models.GridProperties>' could be found (are you missing a using directive or an assembly reference?)

I would appreciate, if you can help to get this sorted. A sample project would be highly appreciated.

Abaid-ur-Rehman Zulfi
Replied On September 9, 2019 12:43 PM UTC

Awaiting reply to fix this issue. 

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On September 9, 2019 01:49 PM UTC

Hi Abaid,  

Greetings from Syncfusion.  

Please confirm whether you are using the EJ1 Grid or EJ2 Grid. Following link refers to the EJ2 Grid in Asp.Net MVC 

If you could provide the details requested by us, it would be easier for us to guide you on your requirement. 

Seeni Sakthi Kumar S 

Abaid-ur-Rehman Zulfi
Replied On September 10, 2019 06:07 AM UTC

I am using EJ2 gird in ASP.net Core 2.2 (not ASP.net MVC). Since, I couldn't find any example to access EJ2 controls dynamically in ASP.net core, I took code from MVC thread. 

My objective is to access EJ2 DataGrid dynamically so I can change attributes/Datasource on the fly in controller. Please let me know how I can achieve this!

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On September 11, 2019 06:49 AM UTC

Hi Abaid,  

We have already discussed about updating the Grid dataSource dynamically and refreshing the Grid content in the following Help Document.  

Seeni Sakthi Kumar S 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon