TelerikGrid: Binding complex object field to DataGridTextColumn

2 posts, 0 answers
  1. shalini
    shalini avatar
    1 posts
    Member since:
    May 2015

    Posted 18 Jun 2015 Link to this post

    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.

  2. Tsvyatko
    Admin
    Tsvyatko avatar
    832 posts

    Posted 22 Jun 2015 Link to this post

    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
Back to Top