If you have a lookup editor and it is connected to a view that has criteria and the mode is not search. The criteria is not applied.
So in the class XafBootstrapLookupPropertyEditor I have replaced the following code
in my test this works fine I have NOT added this to the code on Github, that is something for you to do.
Old Code :
if (!IsSelector)
{
cs = Helper.CreateCollectionSource(Helper.ObjectSpace.GetObject(CurrentObject));
if (Helper.EditorMode == LookupEditorMode.Auto || Helper.EditorMode == LookupEditorMode.AllItemsWithSearch)
IsSelector = cs != null && cs.List.Count > 20;
}
New code:
if (!IsSelector)
{
cs = Helper.CreateCollectionSource(Helper.ObjectSpace.GetObject(CurrentObject));
if (cs != null && Model.View is IModelListView && !string.IsNullOrEmpty(((IModelListView)Model.View).Criteria))
cs.Criteria.Add("ViewCriteria",CriteriaOperator.Parse(((IModelListView)Model.View).Criteria));
if (Helper.EditorMode == LookupEditorMode.Auto || Helper.EditorMode == LookupEditorMode.AllItemsWithSearch)
IsSelector = cs != null && cs.List != null && cs.List.Count > 20 ;
}
If you have a lookup editor and it is connected to a view that has criteria and the mode is not search. The criteria is not applied.
So in the class XafBootstrapLookupPropertyEditor I have replaced the following code
in my test this works fine I have NOT added this to the code on Github, that is something for you to do.
Old Code :
if (!IsSelector)
{
cs = Helper.CreateCollectionSource(Helper.ObjectSpace.GetObject(CurrentObject));
if (Helper.EditorMode == LookupEditorMode.Auto || Helper.EditorMode == LookupEditorMode.AllItemsWithSearch)
IsSelector = cs != null && cs.List.Count > 20;
}
New code:
if (!IsSelector)
{
cs = Helper.CreateCollectionSource(Helper.ObjectSpace.GetObject(CurrentObject));
if (cs != null && Model.View is IModelListView && !string.IsNullOrEmpty(((IModelListView)Model.View).Criteria))
cs.Criteria.Add("ViewCriteria",CriteriaOperator.Parse(((IModelListView)Model.View).Criteria));
if (Helper.EditorMode == LookupEditorMode.Auto || Helper.EditorMode == LookupEditorMode.AllItemsWithSearch)
IsSelector = cs != null && cs.List != null && cs.List.Count > 20 ;
}