/// <summary> /// /// </summary> /// <param name="filter"></param> protected virtual void OnFilterRemove(GridFilter filter) { if (filter.MenuItems.Count > 0) { foreach (MenuItemBase item in filter.MenuItems) { if (this.FeatureOwner.Controls.Contains(item)) { this.FeatureOwner.Controls.Remove(item); } if (this.FeatureOwner.LazyItems.Contains(item)) { this.FeatureOwner.LazyItems.Remove(item); } } } }
/// <summary> /// /// </summary> /// <param name="filter"></param> protected virtual void OnFilterRemove(GridFilter filter) { if (filter.MenuItems.Count > 0) { foreach (MenuItemBase item in filter.MenuItems) { if (this.FeatureOwner.Controls.Contains(item)) { this.FeatureOwner.Controls.Remove(item); } if (this.FeatureOwner.LazyItems.Contains(item)) { this.FeatureOwner.LazyItems.Remove(item); } } } if (filter.GetType() == typeof(ListFilter)) { Menu menu = (filter as ListFilter).MenuConfig; if (menu != null) { if (!this.FeatureOwner.Controls.Contains(menu)) { this.FeatureOwner.Controls.Add(menu); } if (!this.FeatureOwner.LazyItems.Contains(menu)) { this.FeatureOwner.LazyItems.Add(menu); } } } }
/// <summary> /// Adds a filter to the collection and observes it for state change. /// </summary> /// <param name="filter">A filter configuration</param> public virtual void AddFilter(GridFilter filter) { RequestManager.EnsureDirectEvent(); this.Call("addFilter", new ClientConfig().Serialize(filter)); }
private void Filters_AfterItemRemove(GridFilter item) { this.OnFilterRemove(item); }
private void Filters_AfterItemAdd(GridFilter item) { item.Plugin = this; }