This question is locked. New answers and comments are not allowed.
Hi, got myself a TreeListView on my page with the ItemSource bound to a collection of poco objects. How do I convert the tree view's Items property back into the collection of strongly typed objects? I want to get the collection back strongly typed so I can use linq to query it as shown here:
IEnumerable<UserPermission> permissionList = (IEnumerable<UserPermission>)OperationList.Items;
UserPermission permission = permissionList.Where(a => a.Permission == Enum.Parse(a.Permission.GetType(), acl.Permission.ToString(), true)).FirstOrDefault();
This currently explodes with:
Cannot cast '((Telerik.Windows.Controls.DataControl)(this.OperationList)).Items' (which has an actual type of 'Telerik.Windows.Data.DataItemCollection') to 'System.Collections.Generic.IEnumerable<MyNamespace.UserPermission>'