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

Using ClientDataKeyNames with a "aggregated object" property

1 Answer 68 Views
Grid
This is a migrated thread and some comments may be shown as answers.
dstj
Top achievements
Rank 1
dstj asked on 09 Jan 2009, 05:07 PM
Hi,

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...

Thanks,

Dominic.

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 12 Jan 2009, 02:08 PM

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,

Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
dstj
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or