With Sitecore, I figured it out. Basically you need to create a custom control that inherits from MultilistEx. Then you need to override the DoRender () event. Before calling base.DoRender (), you must change the source (this.Source) to use the Sitecore request. I used to try to do this in the OnLoad event. So now my code is as follows:
public class CustomMultiList : MultilistEx { private void ExcludeItems() { ...custom code here that builds a list of Item IDs to exclude from the Multilist source... ...list should look like this "@@id != 'some guid' and @@id != 'some guid' and so forth... ...you could also build a list of item ids to include. Any Sitecore query will do... ...you can use this.ItemID to get a reference to the current item that is being edited in the Content Editor... this.Source = "query:" + this.Source + "
source share