Fit Daily view to control height in Scheduler component

Posted by: mhorne on 3 January 2019, 8:43 am EST

    • Post Options:
    • Link

    Posted 3 January 2019, 8:43 am EST

    Hi -

    Is there a way to make the daily view with resource groupings use the available vertical space rather than having fixed time elements and a scrollbar?

    We are trying to create a “one page” view where the user can see the entire schedule without scrolling.

    If this problem can be solved we will purchase.

    Thanks!

  • Posted 3 January 2019, 8:24 pm EST - Updated 4 October 2022, 12:08 am EST

    Hello,

    As I understand you wish to display 24 hours in one page view, so that end-user does not have to scroll the scheduler to view complete day contents. Something as shown below.



    If it is so, you just need to set VisualIntervalScale to one hour:```

    sched1.VisualIntervalScale = new TimeSpan(1,0,0);

    If there is anything else you need, do let me know.
    
    Thanks,
    Ruchir
    [zip filename="DayView_C1SchedulerSample.zip"]https://gccontent.blob.core.windows.net/forum-uploads/file-51b68abe-b4f3-44da-ac1c-ff3946b85824.zip[/zip]
  • Posted 4 January 2019, 1:06 am EST

    Thanks. With your example code I still see the scrollbar along the edge. Is it possible to also hide the scrollbar?

  • Posted 6 January 2019, 4:05 pm EST

    Hi,

    To make the scrollbar invisible, you may access the ScrollBar element from the VisualTreeHelper and hide it inside LayoutUpdated event handler as follows:```

    private void Sched1_LayoutUpdated(object sender, EventArgs e)

    {

    foreach (System.Windows.Controls.Primitives.ScrollBar sb in FindVisualChildren<System.Windows.Controls.Primitives.ScrollBar>(sched1))

    {

    if (sb.Visibility == Visibility.Visible)

    {

    sb.Visibility = Visibility.Hidden;

    }

    }

    }

    public static IEnumerable FindVisualChildren(DependencyObject depObj) where T : DependencyObject

    {

    if (depObj != null)

    {

    for (int i = 0; i < VisualTreeHelper.GetChildrenCount(depObj); i++)

    {

    DependencyObject child = VisualTreeHelper.GetChild(depObj, i);

    if (child != null && child is T)

    {

    yield return (T)child;

    }

           foreach (T childOfChild in FindVisualChildren<T>(child))
           {
                yield return childOfChild;
           }
       }
    

    }

    }

    Ruchir
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels