I am trying to get a Datagrid to work using Self Referencing heirarchy, but I get the error: No property or field 'ParentID' exists in type 'DataRowView' when I add the FilterExpression:
RadGrid1.MasterTableView.FilterExpression =
"ParentID is null "
The code is modeled after the sample here
I can get it to work without the FilterExpression, but all items show up under the main grid, and then again as children. It seems very simple, but I must be missing something.
5 Answers, 1 is accepted
If this is Telerik.Web.UI for .NET 3.5 please set EnableLinqExpressions to false and let me know about the result.
Regards,
Vlad
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

That fixed the error, but the self referencing heirarchy is still displaying child records on the root level of the grid, and again in the sub-rows.
Lance

Thanks
Lance

I have a similar problem by implementing the Telerik Web Mail, but I haven't solved it. The error is:
No property or field 'MessageId' exists in type 'DataTable'
To make it short, I have a DataGrid (RadGrid1) which shows the list of emails read from a Windows Exchange Server 2003.
The emails read from the Exchange Server POP3, are memorized in a DataTable (EmailTable) (not in a database as shown in http://demos.telerik.com/aspnet-ajax/webmail/) .
Selecting one of these emails, I would like to show details about the email selected in a DetailsView (DetailsView1), which read the details about the email from the DataTable (EmailTable) by using the LinqDataSource as follow:
<
asp:LinqDataSource
runat
=
"server"
ID
=
"LinqDataSource2"
ContextTypeName
=
"Inbox"
<br>
TableName="EmailTable" Where="MessageId == Convert.ToString(@MessageId)" ><
br
>
<
WhereParameters
><
br
>
<
asp:ControlParameter
ControlID
=
"ctl00$ContentPlaceHolder2$RadGrid1"
Name
=
"MessageId"
/><
br
>
</
WhereParameters
><
br
>
</
asp:LinqDataSource
>
Where ContentTypeName ("Inbox") is the name of the public class containing the public DataTable; TableName("EmailTable") is the name of the DataTable which has read the emails by connecting in the Exchange Server and the where condition contains the name of the Column ("MessageId") which should bring into consideration in order to isolate the email I have chosen in the RadGrid1.
I think that the error is thrown by the where condition, maybe because the columns of a DataTable are "No-public members"?
How can I solve it?
Thank you,
Silvia
<
asp:LinqDataSource
runat
=
"server"
ID
=
"LinqDataSource2"
ContextTypeName
=
"Inbox"
<br>
TableName="EmailTable" Where="MessageId == Convert.ToString(@MessageId)" ><
br
>
<
WhereParameters
><
br
>
<
asp:ControlParameter
ControlID
=
"ctl00$ContentPlaceHolder2$RadGrid1"
Name
=
"MessageId"
/><
br
>
</
WhereParameters
><
br
>
</
asp:LinqDataSource
>
I think the error is caused because the control parameter of the LinqDataSource is not configured properly. Using the current configuration the datasource is looking for a control with server ID "ctl00$ContentPlaceHolder2$RadGrid1" which should have a property called MessageId. Since no control on the page has such property an error is raised. More information on using control parameter can be found in this article.
To achieve the requirement you can set the ControlId to "RadGrid1" and the Name property of the Control parameter to "SelectedValue" which should contain the DataKey of the selected row similar to the approach shown in this demo:
http://demos.telerik.com/aspnet-ajax/Grid/Examples/Programming/SelectedValue/DefaultCS.aspx
Marin
the Telerik team