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

[Solved] Self Referencing hierarchy grid issue

2 Answers 147 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mohan
Top achievements
Rank 1
Mohan asked on 27 May 2009, 09:15 PM
I have the  Person class with the following fields which reflects the table structure.
field               datatype
Id                   long
Name             string
Title               string
Supervisor     long


I want to build a self referencing grid. I keep getting the following error

System.Data.SyntaxErrorException: Syntax error in Lookup expression: Expecting keyword 'Supervisor' followed by a single column argument with possible relation qualifier: Supervisor[(<relation_name>)].<column_name>.


I have tried the various combinations of filterexpression in the Page_load event but none seem to work.

 RadGrid1.MasterTableView.FilterExpression = "Supervisor = 0";
 RadGrid1.MasterTableView.FilterExpression = "it.Supervisor = 0";

I am populating ICollection<Person> and setting it to the RadGrid1 datasource property.

I am not sure what is causing this error. I have looked through the forums but havent found any help in this matter.

Thanks

2 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 30 May 2009, 01:22 PM
Hello Mohan,

You can try to set EnableLinqExpressions to "false". If you need to show only root items you can try use this code snippet:
RadGrid1.MasterTableView.FilterExpression = "Supervisor IS NULL"

I will suggest you examine this online demo devoted on the same matter. For your convenience I have attached a test project which implements the required functionality.

Regards,
Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Truong Pham
Top achievements
Rank 1
answered on 10 Mar 2010, 03:59 PM
I have the same above problem and I tried to change EnableLinqExpressions to "false" and it works. Thanks
Tags
Grid
Asked by
Mohan
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Truong Pham
Top achievements
Rank 1
Share this question
or