GanttView Time Range Day Does not display properly

3 posts, 1 answers
  1. Josh
    Josh avatar
    2 posts
    Member since:
    Jun 2014

    Posted 13 Jan Link to this post

    I have a gantt view that I want to populate with data, but when i set it to the day range the the major timeline grid sizing seems to scale to the size of the container rather than to the secondary time line grid (see attached picture). The gantt view items are properly scaled to the major grid, but the secondary timeline markings are wrong. Is there a setting that i can use to make the major timeline grid marks stretch over all the available secondary timeline markings?

    This is running on windows 10, telerik ui for winforms 2016 R3.

    To replicate the issue create a new project with a gantview and use the following code in the load function.

            RadGanttView1.GanttViewElement.GraphicalViewElement.TimelineRange = Telerik.WinControls.UI.TimeRange.Day
            RadGanttView1.GanttViewElement.GraphicalViewElement.TimelineStart = Today
            RadGanttView1.GanttViewElement.GraphicalViewElement.TimelineEnd = Today.AddHours(24)
            Dim tasks As New DataTable("Tasks")
            tasks.Columns.Add("Id", GetType(Integer))
            tasks.Columns.Add("ParentId", GetType(Integer))
            tasks.Columns.Add("Title", GetType(String))
            tasks.Columns.Add("Start", GetType(DateTime))
            tasks.Columns.Add("End", GetType(DateTime))
            tasks.Columns.Add("Progress", GetType(Decimal))
            Dim links As New DataTable("Links")
            links.Columns.Add("StartId", GetType(Integer))
            links.Columns.Add("EndId", GetType(Integer))
            links.Columns.Add("LinkType", GetType(Integer))
            Dim data As New DataSet()
            data.Tables.Add(tasks)
            data.Tables.Add(links)
            tasks.Rows.Add(1, 0, "Summary task title", Today.AddHours(11), Today.AddHours(12), 30D)
            tasks.Rows.Add(2, 1, "First child task title", Today.AddHours(11), Today.AddHours(11.5), 10)
            tasks.Rows.Add(3, 1, "Second child task title", Today.AddHours(11.5), Today.AddHours(12), 20D)
            tasks.Rows.Add(4, 1, "Milestone", Today.AddHours(12), Today.AddHours(12), 0D)
            links.Rows.Add(2, 3, 1)
            links.Rows.Add(3, 4, 1)
            Me.RadGanttView1.GanttViewElement.TaskDataMember = "Tasks"
            Me.RadGanttView1.GanttViewElement.ChildMember = "Id"
            Me.RadGanttView1.GanttViewElement.ParentMember = "ParentId"
            Me.RadGanttView1.GanttViewElement.TitleMember = "Title"
            Me.RadGanttView1.GanttViewElement.StartMember = "Start"
            Me.RadGanttView1.GanttViewElement.EndMember = "End"
            Me.RadGanttView1.GanttViewElement.ProgressMember = "Progress"
            Me.RadGanttView1.GanttViewElement.LinkDataMember = "Links"
            Me.RadGanttView1.GanttViewElement.LinkStartMember = "StartId"
            Me.RadGanttView1.GanttViewElement.LinkEndMember = "EndId"
            Me.RadGanttView1.GanttViewElement.LinkTypeMember = "LinkType"
            Me.RadGanttView1.GanttViewElement.DataSource = data
            Me.RadGanttView1.Columns.Add("Start")
            Me.RadGanttView1.Columns.Add("End")

     

  2. Answer
    Hristo
    Admin
    Hristo avatar
    1028 posts

    Posted 16 Jan Link to this post

    Hello Josh,

    Thank you for writing.

    The observed behavior is caused by insufficient space for fitting all of the hours. As you have observed the task elements appear correct compared to the parent header, the hours, however, cannot fit. 

    In these scenarios, it is appropriate to use a small scale for the graphical view. The OnePixelTime property determines how much time a single pixel represents. You can try setting it this way: 
    Me.RadGanttView1.GanttViewElement.GraphicalViewElement.OnePixelTime = New TimeSpan(0, 1, 0)

    I am also attaching a screenshot showing the result on my end. In addition, please also check the following feature request. I have added a vote for it on your behalf. It also features a solution with a custom layout handling scenarios similar to yours.

    I hope this helps. Please let me know if you need further assistance.

    Regards,
    Hristo
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Josh
    Josh avatar
    2 posts
    Member since:
    Jun 2014

    Posted 16 Jan Link to this post

    Thank you,
    That fixes the issue that I was having.
Back to Top