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

GridInsertionObject does not contain a property with the name

1 Answer 272 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 2
Dan asked on 08 Jan 2009, 04:04 PM
I too have run into this error:

DataBinding: 'Telerik.WebControls.GridInsertionObject' does not contain a property with the name 'subject'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: DataBinding: 'Telerik.WebControls.GridInsertionObject' does not contain a property with the name 'subject'.

The error results from initiating an insert from a grid that has no rows/records.  If the grid has existing records, the insert works fine.

What I found, in my case, is a simple fix to the problem.  My SqlData Source was:

<asp:SqlDataSource ID="dsParent" runat="server" DataSourceMode="DataReader"></asp:SqlDataSource>

The problem disappeared by removing the DataSourceMode property thus:

<asp:SqlDataSource ID="dsParent" runat="server"></asp:SqlDataSource> 

I hope this will help someone down the line who runs into this problem again.  This may not solve everyones problem with this error message, but it fixed mine.  Happy coding!

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 09 Jan 2009, 05:21 AM
Hello ,

You can also refer the following help article which explains more about this error and ways in which it can be fixed.
Known reasons for error messages

Shinu
Tags
Grid
Asked by
Dan
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Share this question
or