Using ClientDataKeyNames with a "aggregated object" property

2 posts, 0 answers
  1. dstj
    dstj avatar
    82 posts
    Member since:
    Oct 2006

    Posted 09 Jan 2009 Link to this post


    Using RadGrid v2008.3.1204.35, I'm DataBinding to an object datasource. Each object has aggregated objects, for example
    class ClassA { 
      private ClassB _objB; 
      private ClassC _objC; 
      public ClassB ObjB { get { return _objB; } } 
      public ClassC ObjC { get { return _objC; } } 

    List<ClassA> list = new List<ClassA>(); 
    RadGrid.DataSource = list; 

    I'm trying to set ClientDataKeyName to use the Id of the an aggregate object :
    <MasterTableView ClientDataKeyNames="ObjB.Id"

    but I receive the following exception :
    DataBinding: 'ClassA' does not contain a property with the name 'ObjB.Id' 

    I am able to declare a GridBoundColumn's DataField to the following without any problem though :
    <telerik:GridBoundColumn UniqueName="Name" DataField="ObjB.Name" DataType="System.String" HeaderText="Name" /> 

    What is the problem? Can you provide any valid workaround ? I've found this thread, but is there a better way ? I'd like to avoid using a flat DataSet or a flat result object if possible...


  2. Rosen
    Rosen avatar
    3247 posts

    Posted 12 Jan 2009 Link to this post

    Hi ,

    I'm afraid the nested properties as ClientDataKeyNames are currently  not supported by our RadGrid control. However we will do our best to add such functionality for the next version of the control.

    Please excuse us for the inconvenience.

    Kind regards,

    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top