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

No property or field 'ParentID' exists in type 'DataRowView' In Self Referencing Heirarchy

5 Answers 1032 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lance
Top achievements
Rank 1
Lance asked on 08 Oct 2008, 03:19 AM
Hi, 
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

Sort by
0
Accepted
Vlad
Telerik team
answered on 08 Oct 2008, 07:12 AM
Hi Lance,

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.
0
Lance
Top achievements
Rank 1
answered on 08 Oct 2008, 04:51 PM
Thanks Vlad,

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
0
Lance
Top achievements
Rank 1
answered on 08 Oct 2008, 04:54 PM
Nevermind that last post,  it actually is working now.

Thanks
Lance
0
Silvia
Top achievements
Rank 1
answered on 16 Jan 2013, 06:22 PM
Hi,
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

0
Marin
Telerik team
answered on 21 Jan 2013, 11:26 AM
Hi,

 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

All the best,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Lance
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Lance
Top achievements
Rank 1
Silvia
Top achievements
Rank 1
Marin
Telerik team
Share this question
or