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.

TagHelper syntax for local datasource with List<Object> in ViewBag.

Thread ID:





129774 Apr 3,2017 07:16 AM Apr 5,2017 01:27 AM ASP.NET Core 3
Tags: Grid
Alan Bourke
Asked On April 3, 2017 07:16 AM

     I'm trying to get a Grid working with a List<MyObject> contained in ViewBag.txns.

What is the Razor syntax for a local datasource like this, using TagHelpers? I've tried below but it doesn't work:

        <ej-grid id="FlatGrid" datasource="ViewBag.txns">
                <e-column field="TransactionDate" header-text="Date" text-align="Left" width="70" format="{0:MM/dd/yyyy}"></e-column>
                <e-column field="Reference1" header-text="Reference" width="80"></e-column>
                <e-column field="Balance" header-text="Balance" text-align="Right" width="75"></e-column>


Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On April 4, 2017 04:51 AM

Hi Alan,  
Thanks for contacting Syncfusion support.  
We are unable to reproduce any problem with the given code snippet. The format given in your code example for binding datasource to the Grid is correct and we are not finding any error with this code example.  
<ej-grid id="FlatGrid" allow-sorting="true" datasource="ViewBag.parent" allow-paging="true"> 
        <e-column field="EmployeeID" header-text="Employee ID"  width="75"></e-column> 
        <e-column field="FirstName" header-text="First Name" width="80"></e-column> 
        <e-column field="LastName" header-text="Last Name" visible="false" width="75"></e-column> 
We have prepared a sample that can be downloaded from the following location. 
Please share the following details to analyze the problem at our end.  
1)      Code example of the code behind 
2)      Screenshot for the issue 
3)      Version of the Essential Studio 
4)      If possible, modify the attached sample and reproduce the issue 
Seeni Sakthi Kumar S. 

Alan Bourke
Replied On April 4, 2017 06:14 AM

Thanks the sample works fine, the problem was something else in the end. FWIW ViewBag.whatever without quotes also works.

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On April 5, 2017 01:27 AM

Hi Customer,  
Thanks for the update. 
We are happy to hear that your requirement has been resolved. Please get back to us, if you require further assistance on this. 
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.

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.