Example #1
0
        public override bool ApplyChanges()
        {
            EnsureChildControls();
            CustomProperties3 webpart = this.WebPartToEdit as CustomProperties3;

            webpart.UserGreeting  = txtUserGreeting.Text;
            webpart.TextFontSize  = Convert.ToInt32(lstFontSizes.Text);
            webpart.TextFontColor = lstFontColors.Text;
            // return true to force Web Part Manager to persist changes
            return(true);
        }
Example #2
0
        public override void SyncChanges()
        {
            EnsureChildControls();
            CustomProperties3 webpart = this.WebPartToEdit as CustomProperties3;

            // initialize textbox with UserGreeting property
            txtUserGreeting.Text = webpart.UserGreeting;
            // initialize RadioButtonList to select current font size
            ListItem FontItem = lstFontSizes.Items.FindByText(webpart.TextFontSize.ToString());

            FontItem.Selected = true;
            // initialize RadioButtonList to select current font color
            lstFontColors.Items.FindByText(webpart.TextFontColor).Selected = true;
        }