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

$expand nested properties

Thread ID:





147985 Sep 30,2019 08:04 PM UTC Oct 4,2019 03:48 AM UTC Angular - EJ 2 3
Tags: Grid
Kelly Harrison
Asked On September 30, 2019 08:04 PM UTC

I'm able to $expand multiple levels of nested properties as follows:

        this.query = new Query().expand('Product($expand=Customer)');

While this works, it is awkward to manipulate the odata uri this way and I don't know if it's supported.  Is there a better way to do this?  Traditional dot-style property notation in <e-column> doesn't seem to make the DataManager add the $expand option to the uri.



Thavasianand Sankaranarayanan [Syncfusion]
Replied On October 1, 2019 08:50 AM UTC

Hi Kelly, 

Thanks for contacting us. 

You can manipulate the expand Query using “query” property of Grid as like the below way. Please refer the code example and sample from the link below, 

<div class="control-section"> 
    <ejs-grid #grid [dataSource]='data' [query]="query" [pageSettings]='pageSettings'> 
            <e-column field='UserName' headerText='Customer ID' width='160'></e-column> 
            <e-column field='FirstName' width='120' textAlign='Right'></e-column> 
            <e-column field='LastName' width='150' ></e-column> 

const SERVICE_URI: string = 'https://services.odata.org/V4/(S(0j5uiuuhvaybfuc2llcclf3g))/TripPinServiceRW/People'; 
    selector: 'app-root', 
    templateUrl: 'app.component.html' 
export class AppComponent { 
    public data: DataManager;  
    public pageSettings: Object;  
public query:any 
    @ViewChild('grid',{static: true}) 
    public grid: GridComponent; 
    ngOnInit(): void { 
        this.data= new DataManager({ url: SERVICE_URI, adaptor: new ODataV4Adaptor }) 
        this.query = new Query().expand('Trips'); 


Please get backto us, if you need further assistance. 

Thavasianand S. 

Kelly Harrison
Replied On October 1, 2019 12:22 PM UTC

That's exactly what I'm doing.  However, that doesn't answer the question of nested properties with multiple levels.  In my case, it's something like this:

ProductInventory -> Product -> Customer

In the grid displaying ProductInventory data, I want to show the Customer name.  Using .expand('Product.Customer') doesn't work while my method does.  However that doesn't seem to be the way the API is meant to be used.

Manivel Sellamuthu [Syncfusion]
Replied On October 4, 2019 03:48 AM UTC

Thanks for your update. 
We havevalidated your requirement. you can expand multiple levels by nesting the expand param. Please find the below nested expand query. 
 this.query = new Query().expand('Products($expand=Customer)');  
Please get back to us, if you need further assistance. 


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