In reading about the LinqBindingList<T> it states.
"adding an item to a LinqBindingList adds the item to the original list as well as any other LinqBindingList"
This is true however when I first do an orderby("Id Asc") then later attempt to add a new item to the LinqBindingList collection the item is added to the source '_list' yet the '_filterIndex' remains unchanged. It seems strange that an OrderBy would effect this. I would expect both lists to get the newly added item since there was no filter criteria that would exclude this.
Has anyone encounterd this?
Brette
Thanks for the reply. To help you in your sample here is what I am doing.
//When ourWPF Screen loads.
OperationList = BusinessObject.Operations.OrderBy(operation => operation.OperationName) as LinqBindingList<AssociatedOperation>;
The OperationList is then bound to a ListView. When the add button is clicked the following code is executed.
OperationList.Add(Operation.Create());
At this time the _list shows the newly added item but the _filterIndex does not. In order to get it to work I have to do the following.
//Add Item to list
BusinessObject.Operations.Add(Operation.Create());
//Recreate LinkBindingList
OperationList = BusinessObject.Operations.OrderBy(operation => operation.OperationName) as LinqBindingList<AssociatedOperation>;
This is not a horrible solution but it does not seem right.
Thanks,
Brette
Copyright (c) Marimer LLC