- Home
- Forum
- ASP.NET Core - EJ 2
- Grid showing empty rows
Grid showing empty rows
I have a project where I am using the ejs-grid control.
I have it working well on one page within the application, but when using it on a second page I am having problems.
The grid partially renders on the screen in that there is the correct number of rows on the grid but all the grid lines are empty.
I am using the following:
<ejs-grid id="Grid" dataSource="ViewBag.Results" height="380" allowSorting="true" allowTextWrap="true" width="auto">
<e-grid-columns>
<e-grid-column field="VersionVersion" headerText="FHIR Version" width="30" ></e-grid-column>
<e-grid-column field="Name" headerText="Package Name" width="50"></e-grid-column>
<e-grid-column field="Description" headerText="Description" width="120"></e-grid-column>
<e-grid-column headerText="Action" width="30" template="#commands"></e-grid-column>
</e-grid-columns>
</ejs-grid>
Where ViewBag.Results is List<Version> VersionList
and Version is defined as
public partial class Version
{
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("version")]
public string VersionVersion { get; set; }
[JsonProperty("description")]
public string Description { get; set; }
[JsonProperty("url")]
public Uri Url { get; set; }
public SyncStatusValue SyncStatus { get; set; }
}
As the grid has the correct numbers of rows, I am confident that the populated list is being used. The fields within the grid columns are correct so I dont know why the data is not displaying.
Any ideas?
SIGN IN To post a reply.
3 Replies
AG
Ajith Govarthan
Syncfusion Team
March 26, 2020 11:22 AM UTC
Hi Richard,
Greetings from Syncfusion.
We have checked with the attached code snippet and prepared sample based on your requirement and we found that everything works find at our end. We suspect that you have not added ContractResolver in your startup.cs file. So please ensure that you have added contractResolver in your startup.cs file. We have attached the prepared sample so please refer the sample for your reference.
Sample Link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/WebApplication8_-_dual_grid-332923068.zip
Documentation Link: https://ej2.syncfusion.com/aspnetcore/documentation/grid/data-binding/#troubleshoot-grid-render-rows-without-data
If the above solution doesn’t meet your requirement please share the below details to validate further on your requirement.
1. Share the complete grid code sample.
2. Do you face any script error while rendering grid on second page? If yes, share the screenshot of an issue.
3. Share the video demonstration of the reported issue.
4. Share the Syncfusion Package Version.
Regards,
Ajith G.
RI
Richard
March 27, 2020 11:53 AM UTC
Thanks for the response. I have amended my 'field' bindings to camelCase equivalents and it works fine now.
thank you
Richard
AG
Ajith Govarthan
Syncfusion Team
March 30, 2020 11:34 AM UTC
Hi Richard,
Thanks for the update.
We are happy to hear that your issue has been resolved.
Regards,
Ajith G.
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
RI Richard
- Mar 25, 2020 11:30 PM UTC
- Mar 30, 2020 11:34 AM UTC