Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
505
Change Text of ButtonUIElment embed inside TimeSlotUIElement issue
posted
I have this code to create Button in a UltraMonthViewSingle, 
I use click event of embebded ButtonUIElement to change the Text of it,
But when I change the Form size (maximum Form) or click on other UIElement (DayNUmberUIElement, Owner),
the Text of ButtonUIElement return to its orginial value.
Help me  to solve this problem, please.
Thank you.
public void AfterCreateChildElements(UIElement parent)
        {
         
            if (parent is TimeSlotUIElement)
            {


                ButtonUIElement txtUI = new ButtonUIElement(parent);
                txtUI.Rect = parent.Rect;
             
                txtUI.Text = "OK";
                txtUI.ElementClick += OnEmbeddedButtonClicked;
                parent.ChildElements.Add(txtUI);
             }

               
        }
protected virtual void OnEmbeddedButtonClicked(object sender, UIElementEventArgs e)
        {

            if (e.Element.GetType() == typeof(Infragistics.Win.ButtonUIElement))
            {
                ButtonUIElement btn = e.Element as ButtonUIElement;

                if (btn.Text == "OK") btn.Text = "CH";
              
                
            }