Zoom Gantt Not Expanding On Window Resize

7 posts, 0 answers
  1. Mike
    Mike avatar
    6 posts
    Member since:
    Aug 2014

    Posted 28 Jan 2015 Link to this post

    I have attached an example which is 100% the First Look GanttView reduced to illustrate the problem I am experiencing.  The Fist Look works fine, my code is clearly missing something.

    1. Run the app.
    2. Make the Window wider.
    3. Zoom all the way to 0 - you will notice now that the GanttView only takes about 1/2 the width of the window.
    4. Zoom all the way to 100 - you will notice the GanttView does zoom in, but the width of th eGanttView stays the same.
    5a. Make the Window wider  - the GanttView properly re-sizes  to fill the entire window.
    5b Scroll the GanttView Horizontally - the GanttView properly re-sizes to fill the entire window.

    The Fist Look works does not have the behavior.  The First Look does not also zoom out to where the GanttView does not fill the entire window.  I believe I'm missing something that sets a minimum zoom limit to keep this odd behavior from happening.

    Ok, so apparently I can't attach a sample project .zip.  Strange.  How would you like me to send you this sample project?

    Thanks,
    Mike
  2. Mike
    Mike avatar
    6 posts
    Member since:
    Aug 2014

    Posted 29 Jan 2015 in reply to Mike Link to this post

    This is a known bug since May 2013.
    ----------------------------------------------------------------------------------------------------------
    Thank you for contacting us with this issue.

    We are aware of this behavior and it is logged in our system. You can find the related feedback item in our Feedback Portal where you can
    track its progress.

    We apologize for the inconvenience caused.

    Regards,

    Polya
    Telerik 
  3. UI for WPF is Visual Studio 2017 Ready
  4. Polya
    Admin
    Polya avatar
    199 posts

    Posted 29 Jan 2015 Link to this post

    Hello Mike,

    Thank you for sharing this answer.
    You can find the link to the related Feedback Item here.

    Regards,
    Polya
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Mike
    Mike avatar
    6 posts
    Member since:
    Aug 2014

    Posted 29 Jan 2015 in reply to Polya Link to this post

    Out of curiosity, is there no work around?  The title of the bug report is actually incorrect "Timeline and Timeruler cannot be enlarged if once shrunk" - because it can be enlarged, and does so itself, if you make the hosting window wider, or use the scroll bar of the control itself.

    I've tried invalidating the control, content, etc, trying to force it to redraw, but it does not work.  I'd even go to the point of posting a WM scroll bar position change of 0 if you thought that would cause the control to properly enlarge, since moving the scroll bar does cause it to enlarge.
  6. Polya
    Admin
    Polya avatar
    199 posts

    Posted 30 Jan 2015 Link to this post

    Hi Mike,

    As the problem lies in the size passed to the TimerulerPart of the RadGanttView the only workaround I can suggest is to force a remeasure.

    For example cause a remeasure in the parent window:

    //For the MainWindow to invalidate its measure:
     
    // Change the PixelLength of the control
    ...
    // Force measure invalidate
    Application.Current.MainWindow.Width++;
    Application.Current.MainWindow.Width--;

    Another approach might be to change the selected item of the RadGanttView to a task outside of the current viewport and then set it back to the initial selected item - this way a scrollIntoView of the panel will be called and the Timeruler part will extend.

    Hope this helps.

    Regards,
    Polya
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  7. Mike
    Mike avatar
    6 posts
    Member since:
    Aug 2014

    Posted 30 Jan 2015 in reply to Polya Link to this post

    I used the parent window++/-- workaround, works well.  

    The window wobbles a little, but it's ok, the gantt expands out full when I adjust the zoom to a larger amount, increasing the size of the gantt view automatically.

    Thanks for your help.

    Mike
  8. Ben
    Ben avatar
    1 posts
    Member since:
    Aug 2013

    Posted 02 Mar Link to this post

    This also works in CodeBehind, with less visual effect:

    {code}

    private ScrollablePanel evPanel_Var;
    private ScrollablePanel evPanel
    {
        get
        {
            if (null == evPanel_Var)
                evPanel_Var = (ScrollablePanel)GanttChart.FindVisualChild("EventsPanel");
            return evPanel_Var;
        }
    }
     
    /// <summary>
    /// In the situation where the Gantt Chart is so zoomed out that the timeline doesn't fill the available space,
    /// when you zoom in again it doesn't automatically adjust the width of the timeline to be wider again. This
    /// is a known issue with Telerik:
    ///    
    /// Calling this function causes the chart to reconsider the size of the timeline, which makes it work as expected.
    /// </summary>
    private void forceGanttChartPanelUpdate()
    {
        if(null != evPanel && evPanel.CalculatedHorizontalScrollBarVisibility == System.Windows.Visibility.Visible)
        {
            evPanel.HorizontalOffset += 0.1;
            evPanel.HorizontalOffset -= 0.1;
        }
    }

Back to Top
UI for WPF is Visual Studio 2017 Ready