How do I need to configure my RadGrid and EntityDataSource to get them to work with hierarchy? I got this to work with LinqToSql but it doesn't seem to work for me with EntityDataSource. I currently have:
<telerik:GridTableView Name="ListItems" DataKeyNames="Id, Parent.Id" DataSourceID="ListItemsDataSource" ... runat="server">
<ParentTableRelation><telerik:GridRelationFields DetailKeyField="Parent.Id" MasterKeyField="Id" /></ParentTableRelation>
<asp:EntityDataSource ID="ListItemsDataSource" ContextTypeName="Blah.Bah" EntitySetName="ListItem" Include="Parent" Where="it.Parent.Id == @ParentId" OrderBy="it.SortOrder" ... runat="server">
<WhereParameters>
<asp:Parameter Name="ParentId" Type="Int32" />
</WhereParameters>
</asp:EntityDataSource>
I'm pretty sure my problem is with the where parameter. It's not hooking into the Grid to fiter the results right. With LinqToSql the DataKeyNames and where paramenters could be identical and it worked, but with entities the DataKeys need to have a dot in them referencing the next object, and you can't put a dot in the parameter name of the where parameter used to filter the datasource. I've tried a bunch of different combinations of ParentId / Parent.Id but I can't seem to get my hierarchy to select with results filtered by the parent record.
If y'all would be kind enough to tell me what time it is or post an example of a grid with hierarchy using two EntityDataSource controls I'd be mighty appreciative. I am also using Automatic CRUD operations on these EntityDataSource controls so I don't think using a fully custom select is going to work, with LINQ I had to use Where.
bd
<telerik:GridTableView Name="ListItems" DataKeyNames="Id, Parent.Id" DataSourceID="ListItemsDataSource" ... runat="server">
<ParentTableRelation><telerik:GridRelationFields DetailKeyField="Parent.Id" MasterKeyField="Id" /></ParentTableRelation>
<asp:EntityDataSource ID="ListItemsDataSource" ContextTypeName="Blah.Bah" EntitySetName="ListItem" Include="Parent" Where="it.Parent.Id == @ParentId" OrderBy="it.SortOrder" ... runat="server">
<WhereParameters>
<asp:Parameter Name="ParentId" Type="Int32" />
</WhereParameters>
</asp:EntityDataSource>
I'm pretty sure my problem is with the where parameter. It's not hooking into the Grid to fiter the results right. With LinqToSql the DataKeyNames and where paramenters could be identical and it worked, but with entities the DataKeys need to have a dot in them referencing the next object, and you can't put a dot in the parameter name of the where parameter used to filter the datasource. I've tried a bunch of different combinations of ParentId / Parent.Id but I can't seem to get my hierarchy to select with results filtered by the parent record.
If y'all would be kind enough to tell me what time it is or post an example of a grid with hierarchy using two EntityDataSource controls I'd be mighty appreciative. I am also using Automatic CRUD operations on these EntityDataSource controls so I don't think using a fully custom select is going to work, with LINQ I had to use Where.
bd