I had the same problem when using the Telerik RadGrid
The problem is that when trying to bind the child's objects properties in the RadGrid its displaing only null data for this fields (tough, the object properties are displayed correctly).
For example: I have RadGrid that displays Payments objects with a column for the CardType description (wich is a child object)
<radG:GridBoundColumn DataField="CardNum" HeaderText="CardNum"/>
<radG:GridBoundColumn DataField="ExpMonth" HeaderText="ExpMonth"/>
<radG:GridBoundColumn DataField="ExpYear" HeaderText="ExpYear"/>
<radG:GridBoundColumn DataField="CardTypeSource.Description" HeaderText="CardTypeSource.Description">
The payment properties were displayed correctly but the card type description was blank.
I asked them for support. Thats their response:
-------------------------------------------------------------------------------------------------------------------------------------------
We reviewed carefully the provided project and we found that the PaymentsBase class implements ICloneable and does not clone properly the sub objects. If the class implements ICloneable, the grid will call the Clone() method which should properly clone all properties and sub objects. Here is a small modification which will avoid the problem:
TF_OERS.Entities\PaymentsBase.generated.cs
|
#region ICloneable Members |
|
///<summary> |
|
/// Returns a Typed Payments Entity |
|
///</summary> |
|
public virtual Payments Copy() |
|
{ |
|
//shallow copy entity |
|
Payments copy = new Payments(); |
|
copy.ID = this.ID; |
|
copy.OriginalID = this.OriginalID; |
|
copy.CheckoutID = this.CheckoutID; |
|
copy.Amount = this.Amount; |
|
copy.Method = this.Method; |
|
copy.CardType = this.CardType; |
|
copy.CardNum = this.CardNum; |
|
copy.ExpMonth = this.ExpMonth; |
|
copy.ExpYear = this.ExpYear; |
|
copy.BillingName = this.BillingName; |
|
copy.BillingAddress = this.BillingAddress; |
|
copy.BillingCity = this.BillingCity; |
|
copy.BillingState = this.BillingState; |
|
copy.BillingCountry = this.BillingCountry; |
|
copy.BillingPostalCode = this.BillingPostalCode; |
|
copy.CheckNum = this.CheckNum; |
|
copy.CheckDate = this.CheckDate; |
|
copy.CheckBank = this.CheckBank; |
|
copy.ChargedStatus = this.ChargedStatus; |
|
copy.Notes = this.Notes; |
|
copy.DateTimeStamp = this.DateTimeStamp; |
|
|
|
copy.CardTypeSource = (CardTypes)this.CardTypeSource.Clone(); |
|
|
|
copy.AcceptChanges(); |
|
return (Payments)copy; |
|
} |
|
|
You can point this info to NetTiers also.
_____________________________________________________
I was working with .NetTiers Version 2.0. Somebody knows if this has been corrected in .NetTiers? What do you recommend should be the approach to fix this?