This question is locked. New answers and comments are not allowed.
So I have the following for my Tree
Then I have the following for my objects
Can you please tell me what I'm missing? I get the following error.
Server Error in '/' Application.
Compiler Error Message: CS1977: Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type
Source Error:
@{ Html.Telerik().TreeView().Name("tvContacts")
.BindTo(ViewBag.Contacts, mappings =>
{
mappings.For<
ContactSite
>(binding => binding
.ItemDataBound((item, site) =>
{
item.Text = site.SiteName;
})
.Children(site => site.ContactGroups));
mappings.For<
ContactGroup
>(binding => binding
.ItemDataBound((item, group) =>
{
item.Text = group.GroupName;
})
.Children(group => group.ContactPeople));
mappings.For<
ContactPerson
>(binding => binding
.itemDataBound((item, person) =>
{
item.Text = person.FirstName + " " + person.LastName;
}));
});
}
Then I have the following for my objects
using System;
using System.Collections.Generic;
using System.Linq;
namespace OnCallTracker.Business
{
public class ContactPage
{
public IEnumerable<
ContactSite
> ContactSites { get; set; }
}
public class ContactSites : List<
ContactSite
>
{
}
public class ContactSite
{
public int SiteId { get; set; }
public string SiteName { get; set; }
public IEnumerable<
ContactGroup
> ContactGroups { get; set; }
}
public class ContactGroups : List<
ContactGroup
>
{
}
public class ContactGroup
{
public int GroupId { get; set; }
public string GroupName { get; set; }
public string GroupDescription { get; set; }
public ContactPerson Manager { get; set; }
public IEnumerable<
ContactPerson
> ContactPeople { get; set; }
}
public class ContactPeople : List<
ContactPerson
>
{
}
public class ContactPerson
{
public int PersonProfileId { get; set; }
public Int64 PersonnelId { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string PersonnelName { get; set; }
public string CellNumber { get; set; }
public string DeskNumber { get; set; }
public string GetContactPersonName()
{
return FirstName + " " + LastName;
}
}
}
Can you please tell me what I'm missing? I get the following error.
Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.Compiler Error Message: CS1977: Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type
Source Error:
|