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
close icon

List of objects

I'm passing a list of objects as the DataSource, however within the object there are some relationships with other objects and rather than pulling the related ids I want to display another field from the relationship.

Hope this makes sense :)

Also I don't want to display all fields from the DataSource is there a way to specify which columns I want visible?

1 Reply

MG Mohanraj Gunasekaran Syncfusion Team September 15, 2017 02:18 PM UTC

Hi Richard, 

Thanks for using Syncfusion product. 

Query 
Solution 
I'm passing a list of objects as the DataSource, however within the object there are some relationships with other objects and rather than pulling the related ids I want to display another field from the relationship. 
By default, GridListControl do not have the direct support to individual binding for columns. So, we cannot create separate columns based on the inner level objects. So, you should generate the DataTable or collection based on your requirement (to get the date based on the relationship id) then try bind that collection with datatable. 

Note: 
GridGroupingControl does have support to bind the inner level object which will automatically generate the RelationTable.  

Also I don't want to display all fields from the DataSource is there a way to specify which columns I want visible? 
In order avoid the specific fields binding with GridListControl you can use Browsable attribute as false. Please refer to the below code example, 

Code example 
//To avoid the below property to bind with GridListControl 
[Browsable(false)] 
public String SampleData 
{ 
    get 
    { 
        return this.sample_Data; 
    } 
    set 
    { 
        this.sample_Data = value; 
    } 
} 

Note: 
The above case applicable for GridGroupingControl also and GridGroupingControl does have the support to remove the column from visible using VisibleColumns property. Please refer the below UG link, 

UG link:  
Binding the data with GridGroupingControl: 
 
Hide the Columns in GridGroupingControl 
 

Please let us know if we misunderstood your scenario. 

Regards, 
Mohanraj G 




Loader.
Live Chat Icon For mobile
Up arrow icon