Scroll bar realted

Posted by: vishnupriya on 8 September 2017, 2:15 pm EST

  • Posted 8 September 2017, 2:15 pm EST


    We have 3 levels of data in the hirarchial grid. And we are hiding the row header and scroll bars for the child views. Only For the parent headings and scrollbar will be avialable.

    But in this case if we want to move the spread using hirizontal scrollbar only the parent view is moving. We are not able to move the Child level views.

    Can some one help us to move the child and parent views simultaneously while moving the parent scroll bars..?

    Thanks in advance


  • Replied 8 September 2017, 2:15 pm EST


    In order to make the Child view Scrollable you may have to set the ViewPortLeftColumn on Spread's LeftChange Event.Have a look at the code below that might help you.

    Private Sub FpSpread1_LeftChange(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.LeftChangeEventArgs) Handles FpSpread1.LeftChange
            Dim alSht1 As ArrayList = FpSpread1.Sheets(0).GetChildSheets()
            Dim alSht2 As ArrayList
            Dim alSht3 As ArrayList
            Dim alSht4 As ArrayList

            Dim spdVw As FarPoint.Win.Spread.SpreadView
            Dim lCol As Integer
            lCol = e.NewLeft
            FpSpread1.SetViewportLeftColumn(0, lCol)

            For Each chlSht1 As FarPoint.Win.Spread.SheetView In alSht1
                spdVw = FpSpread1.GetRootWorkbook().GetSpreadView(chlSht1, 0, 0)
                spdVw.SetViewportLeftColumn(0, lCol)
                alSht2 = chlSht1.GetChildSheets()
                For Each chlSht2 As FarPoint.Win.Spread.SheetView In alSht2
                    spdVw.GetSpreadView(chlSht2, 0, 0).SetViewportLeftColumn(0, lCol)
                    alSht3 = chlSht2.GetChildSheets()
                    For Each chlSht3 As FarPoint.Win.Spread.SheetView In alSht3
                        If Not IsNothing(spdVw.GetSpreadView(chlSht3, 0, 0)) Then
                            spdVw.GetSpreadView(chlSht3, 0, 0).SetViewportLeftColumn(0, lCol)
                        End If
                        alSht4 = chlSht3.GetChildSheets()
                        For Each chlSht4 As FarPoint.Win.Spread.SheetView In alSht4
                            If Not IsNothing(spdVw.GetSpreadView(chlSht4, 0, 0)) Then
                                spdVw.GetSpreadView(chlSht4, 0, 0).SetViewportLeftColumn(0, lCol)
                            End If

        End Sub




  • Replied 8 September 2017, 2:15 pm EST

    Thanks a lot. It is working fine.




Need extra support?

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

Learn More

Forum Channels