December 16, 2017, 10:34:20 PM

See more Support incidents in our old archived forum.

Author Topic: Fexy gantt scroll postion after reload -problem  (Read 3377 times)

Karthikeyan

  • RQ Members
  • Newbie
  • *
  • Posts: 5
Re: Fexy gantt scroll postion after reload -problem
« Reply #15 on: April 25, 2016, 12:50:27 PM »
Ilkka,

We tested our Performance sample with Expanded rows, but didn't see this issue. Please find out the video in http://www.radiantq.com/External/Support/Hotellinx/Ilkka_Apr25.avi


Thanks,
- Karthikeyan K

ilkka.paloheimo

  • Customers
  • Newbie
  • *
  • Posts: 20
Re: Fexy gantt scroll postion after reload -problem
« Reply #16 on: June 29, 2017, 01:40:17 PM »
I have to come back to this same problem once again.

We have still problems to get scroll bars correctly synchronized when UseChartVirtualization="True"
It do not happen all the time but when it happens it causes a lot of troubles for the software users.
And we have to use Virtualization because of its efficiency.

we tried to correct this as you succeeded earlier.
But as you see SetVerticalScrollPercent fails to set vertical scroll bar.
It is 100 after set ?????




 Here is what we do:

 Private Function GetVerticalScrollPercent() As Double
        Dim p As AutomationPeer

        If ResourceFlexyGantt.UseChartVirtualization Then
            p = If(FrameworkElementAutomationPeer.FromElement(ResourceFlexyGantt.GanttChart.VerticalScrollViewerElement), FrameworkElementAutomationPeer.CreatePeerForElement(ResourceFlexyGantt.GanttChart.VerticalScrollViewerElement))
        Else
            p = If(FrameworkElementAutomationPeer.FromElement(ResourceFlexyGantt.GanttChart.VerticalScrollViewerElement), FrameworkElementAutomationPeer.CreatePeerForElement(ResourceFlexyGantt.GanttChart.VerticalScrollViewerElement))
        End If
        Dim chartScrollProvider = TryCast(p.GetPattern(PatternInterface.Scroll), IScrollProvider)
        Return chartScrollProvider.VerticalScrollPercent
End Function

Private Sub SetVerticalScrollPercent(grid As DataGrid, direction As ScrollDirection, vp As Double)
        ' Get the scroll provider of the grid.
        Dim p1 As AutomationPeer = If(FrameworkElementAutomationPeer.FromElement(grid), FrameworkElementAutomationPeer.CreatePeerForElement(grid))
        Dim scrollProvider As IScrollProvider = TryCast(p1.GetPattern(PatternInterface.Scroll), IScrollProvider)
        ' Scroll.
        Select Case direction
            Case ScrollDirection.Up, ScrollDirection.Down
                If scrollProvider.VerticallyScrollable Then
                    scrollProvider.SetScrollPercent(System.Windows.Automation.ScrollPatternIdentifiers.NoScroll, vp)
                End If
                Exit Select
            Case ScrollDirection.Left, ScrollDirection.Right
                If scrollProvider.HorizontallyScrollable Then
                    scrollProvider.SetScrollPercent(vp, System.Windows.Automation.ScrollPatternIdentifiers.NoScroll)
                End If
                Exit Select
        End Select
End Sub

Private Async Sub FillFlexyGantt() ' get data

     vp = Me.GetVerticalScrollPercent()

   .......
   read data from Sql Server
   ResevationsItemSource = GetReservations(....
   ' ResevationsItemSource = binding collecton
   .......

    ' Check and set the scroll percent to the grid.
          Do While ResourceFlexyGantt.FlexyTable.AsControl.IsEnabled = False
                Await System.Threading.Tasks.Task.Run( _
                Sub()
                    System.Threading.Thread.Sleep(100) ' Give time for view to be updated before resetting scroll bar
                End Sub)
          Loop
            Dim vp2 As Double = GetVerticalScrollPercent()
            If vp2 <> vp Then
                If vp > 0 And ResourceFlexyGantt.FlexyTable.AsControl.IsEnabled = True Then
                    Dim grid As DataGrid = DirectCast(ResourceFlexyGantt.FlexyTable.AsControl, DataGrid)
                    SetVerticalScrollPercent(grid, ScrollDirection.Up, vp)
                End If
            End If

            System.Diagnostics.Debug.WriteLine("Scroll before: " & vp.ToString & " After: " & vp2.ToString)
     ...........
End Sub
 



Scroll before: 53.3333333333333 After: 100
Scroll before: 56.25 After: 100
Scroll before: 56.25 After: 100
Scroll before: 53.3333333333333 After: 100

Rajagopal

  • RQ Members
  • Jr. Member
  • *
  • Posts: 91
Re: Fexy gantt scroll postion after reload -problem
« Reply #17 on: June 30, 2017, 01:22:17 PM »
Hi Ilkka,

We couldn't reproduce the reported issue. We have sent you the reference sample and video to your email. Can you please help us to reproduce the issue in that reference sample?

Thanks
Raja

ilkka.paloheimo

  • Customers
  • Newbie
  • *
  • Posts: 20
Re: Fexy gantt scroll postion after reload -problem
« Reply #18 on: July 13, 2017, 07:21:37 AM »
Hello,
This problem don't occur regularly. We have several users of this program but only few has the problem. It seems to depend on the number of lines and group (in all cases less than140 lines and 3-4 groups). In these cases SetVerticalScrollPercent fails to set the value properly. We discovered that if we create a background thread where we have a short delay before we do SetVerticalScrollPercent, it works. But not in same thread with any delay.

I hope that the basic error could be fixed because the view jumps up and down. So this is a cosmetic problem left.

Rajagopal

  • RQ Members
  • Jr. Member
  • *
  • Posts: 91
Re: Fexy gantt scroll postion after reload -problem
« Reply #19 on: July 13, 2017, 02:20:08 PM »
Ilkka,

Thanks for sharing your workaround calling SetVerticalScrollPercent in a separate thread. We will keep an eye on this and fix this as soon as we can reproduce this.


Thanks
Raja