public override void ApplyChanges() { LeftNewsContent parentWebPart = (LeftNewsContent)this.ParentToolPane.SelectedWebPart; //base.ApplyChanges(); //_myParent.GroupName = ddlTypes.SelectedItem.Text; RetrievePropertyValues(this.Controls, parentWebPart); }
private void RetrievePropertyValues(ControlCollection controls, LeftNewsContent parentWebPart) { foreach (Control ctl in controls) { RetrievePropertyValue(ctl, parentWebPart); if (ctl.HasControls()) { RetrievePropertyValues(ctl.Controls, parentWebPart); } } }
private void RetrievePropertyValue(Control ctl, LeftNewsContent parentWebPart) { if (ctl is DropDownList) { if ("SelectType".Equals(ctl.ID)) { DropDownList drp = (DropDownList)ctl; if (drp.SelectedItem.Value != "") { parentWebPart.GroupName = drp.SelectedItem.Text; parentWebPart.NewsGroupID = drp.SelectedItem.Value; } } } }