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

self hierarchy problem on rebind

3 Answers 110 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Silvio Silva Junior
Top achievements
Rank 2
Silvio Silva Junior asked on 03 May 2011, 03:30 PM
Hello guys.

I'm having a problem when using self hierarchy. I'm using this example:
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/selfreferencing/defaultcs.aspx

I'm doing exactly the same way as it is in this example, but when I do a rebind on the grid, I get the following error:
"No applicable indexer exists in type 'FilesResult'

FilesResult is my datatype of entity framework that is retrieved from the db.

I tryed to use some like this:
 if (Assembly.GetAssembly(typeof(ScriptManager)).FullName.IndexOf("3.5") != -1 || Assembly.GetAssembly(typeof(ScriptManager)).FullName.IndexOf("4.0") != -1)
        {
            RadGrid1.MasterTableView.FilterExpression = "it.arq_int_codigo_pai = Convert.DBNull";
        }
        else
        {
            RadGrid1.MasterTableView.FilterExpression = "arq_int_codigo_pai IS NULL";
        }
but I received the error: 

Operator '=' incompatible with operand types 'Int32?' and 'Object'

 
What can I use when using entity framework?

What's wrong?

Regards.

3 Answers, 1 is accepted

Sort by
0
Shawn
Top achievements
Rank 1
answered on 04 May 2011, 11:35 PM
I'm running into a similar issue "No applicable indexer exists in type 'EntityDataSourceWrapper'"

I'm trying to use that same example for a Dynamic Data site that is using a custom template.

0
Silvio Silva Junior
Top achievements
Rank 2
answered on 05 May 2011, 01:21 PM
Hey Shaw, for me it was fixed setting EnableLinqExpression = "false" in the grid parameters.

http://www.telerik.com/community/forums/aspnet-ajax/grid/self-referencing-hierarchy-using-linq-and-nullable-guids.aspx

Regards.
0
Shawn
Top achievements
Rank 1
answered on 05 May 2011, 03:24 PM
Perfect - just what I needed!

Thanks
Tags
Grid
Asked by
Silvio Silva Junior
Top achievements
Rank 2
Answers by
Shawn
Top achievements
Rank 1
Silvio Silva Junior
Top achievements
Rank 2
Share this question
or