This is a migrated thread and some comments may be shown as answers.

Zoom Gantt Not Expanding On Window Resize

6 Answers 80 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 28 Jan 2015, 02:50 PM
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

6 Answers, 1 is accepted

Sort by
0
Mike
Top achievements
Rank 1
answered on 29 Jan 2015, 02:45 PM
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 
0
Polya
Telerik team
answered on 29 Jan 2015, 04:07 PM
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.

 
0
Mike
Top achievements
Rank 1
answered on 29 Jan 2015, 04:14 PM
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.
0
Polya
Telerik team
answered on 30 Jan 2015, 12:49 PM
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.

 
0
Mike
Top achievements
Rank 1
answered on 30 Jan 2015, 08:20 PM
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
0
Ben
Top achievements
Rank 1
answered on 02 Mar 2016, 01:53 PM

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;
    }
}

Tags
GanttView
Asked by
Mike
Top achievements
Rank 1
Answers by
Mike
Top achievements
Rank 1
Polya
Telerik team
Ben
Top achievements
Rank 1
Share this question
or