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

Unable to cast object

1 Answer 61 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ratndeep
Top achievements
Rank 1
Ratndeep asked on 25 Jan 2010, 11:23 AM
Hi ,
I have Master-Child Table scenerion but there is a need to add master table primary id  into child table directly using child table field but when i do this getting following exception..

Unable to cast object of type 'Open Access Runtime.Relational.Relational Generic OID' to type 'Telerik.OpenAccess.SPI.dataobjects.PersistenceCapable'.

Plz Guide why its happening?

1 Answer, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 26 Jan 2010, 06:49 PM
Hello Ratndeep,

In fact you could use the “Presenting 1:n relations with hierarchical RadGrid and OpenAccess” Code Library example which is located here. In order to display the primary key of the master table you should add the following column inside the child table:

<Columns>
 <telerik:GridBoundColumn DataField="Company.CompanyId" DataType="System.Int32" HeaderText="CompanyId"
  ReadOnly="True" SortExpression="Company.CompanyId" UniqueName="Company.CompanyId">
 </telerik:GridBoundColumn>
 ...
</Columns>

Hope that helps.


Regards,
Damyan Bogoev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Development (API, general questions)
Asked by
Ratndeep
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
Share this question
or