Hi
I am having some problems with my custom entity collection and binding it.
I have called an entitycollection in the normal way but to save going back and for to the database as it is done by webservices I want to filter it locally.
Here's my code for creating the collection:
Main elements is the one called directly from the DB
EntityCollection FilteredElements = new EntityCollection();
IPredicateExpression Filter = new PredicateExpression(ElementFields.GroupID == Id);
List<int> ElementsIndexes = MainElements.FindMatches(Filter);
foreach (int index in ElementsIndexes )
{
FilteredElements.Add((ElementEntity)MainElements[index]);
}
I am then binding it to a Win forms RadComboBox by doing the following:
DropDown.DisplayMember =ElementFields.Name.Name;
BindingTypeDropDown.DropDown.ValueMember =ElementFields.Value.Name;
BindingTypeDropDown.DropDown.DataSource = FilteredElements;
The problem is when I bind it to my dropdown all I get is a repeated list of
"EntityClasses.ElementEntity"
If I put the MainElements entitycollection as the datasource it all works ok.
What am I doing wrong? I have been pulling my hair out all afternoon!
Thanks
Bex