Try our conversational search powered by Generative AI!

Filter event not triggered EPs 4.60

Vote:
 
I've made a custom filter that is supposed to filter out a cetanin pagetype by it's PageTypeName prop. The thing is that it seems that the Filter event is never trigged by EP. I've tryed to debugg by attatching the asp process and it never get's there. I have tryed to put the filter event handler in both OnInit, PageLoad and in a separate class. here is the code: protected PageTree PageTreeControl; private MenuList _menuListControl; private void Page_Load(object sender, EventArgs e) { if(_menuListControl != null) { PageTreeControl.DataSource = _menuListControl; } PageTreeControl.Filter += new FilterEventHandler(PageTreeControl_Filter); if(!IsPostBack) { PageTreeControl.DataBind(); } } override protected void OnInit(EventArgs e) { InitializeComponent(); base.OnInit(e); PageTreeControl.Filter += new FilterEventHandler(PageTreeControl_Filter); } private void PageTreeControl_Filter(object sender, EPiServer.Filters.FilterEventArgs e) { PageDataCollection pdc = e.Pages; for(int i=0; i< pdc.Count; i++) { if(pdc[i].PageTypeName.Equals("Pagetype to filter")) { pdc.RemoveAt(i); i--; } } }
#12615
May 02, 2006 17:56
Vote:
 
Does anyone have a solution or something that might work? i'm stuck here.
#14593
May 10, 2006 13:44
Vote:
 
Hi! I hade the same problem now, but solved it by using this in Page_Load: if(_menuListControl != null) { PageTreeControl.DataSource = _menuListControl.ExpandedPageLink; } /Jonas
#14594
Nov 08, 2007 10:48
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.