This is a migrated thread and some comments may be shown as answers.

TelerikGrid: Binding complex object field to DataGridTextColumn

1 Answer 82 Views
DataGrid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
shalini
Top achievements
Rank 1
shalini asked on 18 Jun 2015, 10:54 AM

Hi ,

<telerikGrid:DataGridTextColumn CanUserEdit="True" CanUserFilter="True" CanUserSort="True" Header ="Segment" Name="Segment" PropertyName="Segment.val"/>

 and there is and object Segment

public class Segment

{

int id;

string val;

}

this is not binding the data to column. If custom template is used, we have to comprise on the filter. Is there any solution where I bind the complex object and also should be able to filter the column. Please help me.

1 Answer, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 22 Jun 2015, 11:54 AM
Hello Shalini,

Nested properties are not supported out of the box. Nevertheless, this functionality can be easily achieved by inheriting DataGridTextColumn. 

I have prepared sample project demonstrating how this can be achieved. Please have a look at the attachment and let me know if this helps.


P.S. Keep in mind that nested properties are not supported in Edit scenario (if you have such scenario you can set CanUserEdit to this column to be displayed in read-only mode always).

Regards,
Tsvyatko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
DataGrid
Asked by
shalini
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Share this question
or