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

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

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.

4 Replies

AZ Abaid-ur-Rehman Zulfi September 9, 2019 07:43 AM

Awaiting reply to fix this issue. 

SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team September 9, 2019 08:49 AM

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 

AZ Abaid-ur-Rehman Zulfi September 10, 2019 01:07 AM

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!

SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team September 11, 2019 01:49 AM

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 

Live Chat Icon For mobile
Up arrow icon