/// <summary> /// Saves the values in an <see cref="EditorPart"/> control to the corresponding properties in the associated <see cref="WebPart"/> control. /// </summary> /// <returns></returns> public override bool ApplyChanges() { AnnouncementsWebPart wp = this.WebPartToEdit as AnnouncementsWebPart; if (wp == null) { return(false); } wp.Category = _categoryList.SelectedValue; return(true); }
/// <summary> /// Retrieves the property values from a <see cref="WebPart"/> control for its associated <see cref="EditorPart"/> control. /// </summary> public override void SyncChanges() { this.EnsureChildControls(); AnnouncementsWebPart wp = this.WebPartToEdit as AnnouncementsWebPart; ListItem item = _categoryList.Items.FindByValue(wp.Category); if (item != null) { item.Selected = true; } else { _categoryList.ClearSelection(); } }