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
Embed a TextUIElement inside a TimeSlotUIElement not show.
posted

I have 2 more questions:

1. if I embed a ButtonUIElement inside a TimeSlotUIElement like the code in above post (http://forums.infragistics.com/forums/t/47504.aspx), everything seem to be OK. But when I embed a TextUIElement, the Text of its property not show and also the click event not fire, the code is:


        public void AfterCreateChildElements(UIElement parent)
        {
          
            if (parent is Infragistics.Win.UltraWinSchedule.TimelineView.TimeSlotUIElement)
            {


                  TextUIElement txtUI = new TextUIElement(parent, "Whatever you want to write");
                  txtUI.Rect = parent.Rect;
             
                  txtUI.Text = "OK";
                  txtUI.ElementClick += OnEmbeddedButtonClicked;
                  parent.ChildElements.Add(txtUI);
            }

               
        }


  /// </summary>
        protected virtual void OnEmbeddedButtonClicked(object sender, UIElementEventArgs e)
        {


            MessageBox.Show("A Clicked on Lable ");
        }

   2. I set a startday and endday of a WinMonthViewSingle control
 to 1 month, but when running application,
 its also show days of next month with disabled.
My question is how to hide (invisible)
these disabled items from the control.

Thank you very much.
    
Parents
  • 71886
    Offline posted

    Hello pnchung,

    I was able to reproduce your scenarios, so:

    To the first question:

    Actually, when you add a TextUIElement in this way, the text of the txtUI(in your case) is shown. However, the color is the same as the color of the element your txtUI resides in, so this might be the reason for the text not to be actually visible, but the text is still there. You could try changing some appearances like in my code sample which is a possible approach for dealing with this behavior:

    ultraTimeLineView1.Appearance.ForeColor = Color.Black;

    As to the second question:

    You could remove the disabled items using creation filter.

    Another possible approach might be setting the DayAppearance.BackColorDisabled and DayAppearance.ForeColorDisabled to the background color of your control(white by default). If you choose the second approach these days will still be shown in run-time, but they will not be visible, because of there appearance settings.

    Please do not hesitate to contact us if you need any additional assistance.

Reply Children