AI OnAI Off
{...}
searcher.Criterias = pcc;
searcher.PageLink = prCrit;
{...}
Which would get the result in one single search.
{...}
foreach (PropertyCriteria pc in pcc) {
searcher.Criterias.Add(pc);
}
searcher.DataBind();
{...}
Robert Palmqvist
OnTrax AB
Global.EPDataFactory.FindPagesWithCriteria(PageReference, PropertyCriteriaCollection)
can only start it's search from a specific PageRef, while the PageSearch can start the search from a PageDataCollection, I need to do the property search first. The normal query search alone works just fine. The property search alone works just fine. If I try the query search based on the results of the property search, the result still shows all the property search results. (Note! The code is altered a bit)private bool DoSearch() { // Add criterias PropertyCriteriaCollection pcc = GetCriteriaCollection(); PageReference prCrit = ContainerPage.GetReferenceFromProperty("LibraryContainerPage"); // start point for prop. search // Find pages with criteria and do normal search on result page collection searcher.DataSource = Global.EPDataFactory.FindPagesWithCriteria(prCrit, pcc); searcher.DataBind(); searcher.SearchQuery = SearchQuery; searcher.MaxAllowHits = 1000; searcher.SortOrder = FilterSortOrder.Alphabetical; searcher.Filter += new EPiServer.WebControls.FilterEventHandler(PageIsLibraryResourcePageType); searcher.DataBind(); // Find pages based on query PageDataCollection pdcFinal = searcher.GetPageDataCollection(); ... // Add result to datagrid dgResult.DataSource = pdcFinal; dgResult.DataBind(); }
I ws almost positive that it it a databinding problem, but I have tried databinding now in different ways. Why, oh why? The DataSource property of the PageSearch class is not read-only so it seems like it should be possible to do it this way. Help, please.