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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:





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

     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 08:51 AM UTC

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 10:14 AM UTC

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 05:27 AM UTC

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.

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