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

EjsGrid Display Data Problem

Thread ID:

Created:

Updated:

Platform:

Replies:

146210 Jul 25,2019 07:29 PM UTC Jul 26,2019 05:56 AM UTC Blazor 1
loading
Tags: Grid
Raul
Asked On July 25, 2019 07:29 PM UTC

I have the following grid:
All columns show the data, except
 <EjsGrid id="Grid" DataSource="@vehicles" AllowPaging="true">
        <GridPageSettings PageSizes="true"></GridPageSettings>
        <GridColumns>
            <GridColumn Field="@nameof(VehicleIJ.VehicleShortName)" HeaderText="Name"></GridColumn>
            <GridColumn Field="@nameof(VehicleIJ.VehicleBrand.VehicleBrandID)" HeaderText="Brand"></GridColumn>
            <GridColumn Field="@nameof(VehicleIJ.VehicleModel.ModelName)" HeaderText="Model"></GridColumn>
        </GridColumns>
    </EjsGrid>
Both fields are strings, If I use another field which is an int: VehicleIJ.VehicleBrand.VehicleBrandID it shows the data.
Note that the fields that are not working are the ones inside another field.

Vignesh Natarajan [Syncfusion]
Replied On July 26, 2019 05:56 AM UTC

Hi Raul,  

Greetings from Syncfusion support.  

Query: “EjsGrid Data display problem” 

We have analyzed the provided code example and prepared a sample using your code example. We are able to reproduce the reported issue at our end too. This is because Grid cannot know what may be inherited and its values related to its base type it is bound to. So we suggest you to resolve the issue by defining the complex property directly in the column definition as below  

Refer the below code example  

<EjsGrid @ref="@grid" AllowPaging="true" DataSource="@data" OnBatchSave="onsave" Toolbar="@(new List<string> {"Add","Edit","Delete","Update","Cancel" })"> 
    <GridEditSettings AllowAdding="true" AllowDeleting="true" AllowEditing="true" Mode="EditMode.Batch"></GridEditSettings> 
    <GridColumns> 
        <GridColumn Field=@nameof(Orders.OrderID) HeaderText="Order ID" Type="number" ISPrimaryKey="true" Width="90"></GridColumn> 
        <GridColumn Field=@nameof(Orders.CustomerID) HeaderText="Customer ID" Type="string" Width="90"></GridColumn> 
        <GridColumn Field=@nameof(Orders.EmployeeID) HeaderText="Employee ID" Type="string" Width="90"></GridColumn> 
        <GridColumn Field=@nameof(Orders.Freight) HeaderText="Freight" Type="number" Width="90"></GridColumn> 
        <GridColumn Field="Employee.Address" HeaderText="Address" Type="string" Width="90"></GridColumn> 
        <GridColumn Field="Employee.ID" HeaderText="ID" Type="number" Width="90"></GridColumn> 
    </GridColumns> 
</EjsGrid> 

Refer the below screenshot for the output 

 

For your convenience we have prepared a sample which can be downloaded from below link  


Please get back to us if you have further queries.  

Regards, 
Vignesh Natarajan. 


CONFIRMATION

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