grid scroll

Posted by: duwhd791 on 8 March 2021, 11:55 am EST

  • Posted 8 March 2021, 11:55 am EST

    Hello, let me ask you a question.
    I've put five grids in the panel, and you can scroll by grid.
    I want to move these grids in one scroll with them spread out.
    Is there a way?
  • Replied 8 March 2021, 4:27 pm EST

    Hi,
    As we understand you want the grids to scroll together when a grid is scrolled. You can use the AfterScroll event of the FlexGrid to get notified when a grid is scrolled and then you can scroll the other grids accordingly using the TopRow and LeftCol property or the ScrollPosition property. Please refer to the sample attached and modify it according to your requirements. If you meant something else, then please let us know your use case so that we can help you further.

    Regards.
    Avnish
    FlexGridMultiScroll.zip
  • Replied 8 March 2021, 5:08 pm EST

    Hello Avnish.
    Thank you for answering my question.
    First of all, I'm on VB.Net Framework 4.6 is in use.
    I'm sorry. I don't know if there is a communication problem or if I don't understand.
    What I want is to create and put 5 grids in one panel.
    When you create and insert it like this, you can see only 4 rows from 3 rows of row each grid, so if the row increases, you have to lower each grid and check the data.
    The grid is too small, causing inconvenience in checking.
    I want to know how to adjust these grids with one scroll.

    PS. I can't open the sample file you sent me. :(

    Regards.
    YUN
  • Replied 9 March 2021, 5:15 pm EST

    Hi YUN,

    Please find the VB sample attached. As we understand you want the grid to scroll collectively so that you can check the data on all the grids without having to scroll each grid one by one. The sample implements the same as we mentioned in the previous reply. Please let us know if the sample fulfills your requirement. If you face any issue running the sample, then please let us know with error details.

    Regards.
    Avnish
    FlexGridMultiScrollVB.zip
  • Replied 9 March 2021, 7:45 pm EST

    Hi Avnish,
    Thank you for your kind reply.
    I think it was a reference problem for the file you sent me,
    so I tried to test it again and it worked fine. :)
    But it was different from the way I wanted it.
    When scrolling through one grid, the bottom drawing is not moving together,
    but I will explain it in the picture,
    but I hope there is only one scroll bar that is shown,
    not the separated scroll bar that moves together.
    Is there a way? I beg you.

    Regards.
    YUN

  • Replied 10 March 2021, 5:55 pm EST

    Hi YUN,

    Please refer to the image attached. If that is something that you want, then please note that implementing that for grids with different data will not be properly possible. If you have grids with similar data then it will be possible to synchronize the row shown in all the grids. For grids with different data, one approach will be to scroll all grids by the same percentage, which might result in different rows being visible in the grids.
    Please let us know your use case and which approach will be suitable for you so that we can help you further.

    Regards.
    Avnish
  • Replied 10 March 2021, 6:09 pm EST

    Hi Avnish,

    Thank you for your kind reply.

    Wow, that's exactly how I wanted it! :D
    Thank you.
    The data varies from grid to grid, so I want all grids to scroll to the same percentage and move each grid.
    Thank you so much if you tell me how to do it!

    Regards.
    YUN
  • Marked as Answer

    Replied 11 March 2021, 6:20 pm EST

    Hi YUN,

    You can use the VScrollBar control as the external scroll bar for the grids. You need to set the Minimum and Maximum property of the scroll bar to 0 and 100 respectively which you can then use to denote the percentage of the scroll. Then you can handle the scroll event of the ScrollBar to capture when it had scrolled and scroll the grids accordingly using the ScrollPosition property of the FlexGrid. You can calculate the amount of scroll to be done using the value of the ScrollBar and the total height of the rows of the grid. Please refer to the sample attached and modify it according to your requirements.

    Regards.
    Avnish
    FlexGridCommonScroll.zip
  • Replied 14 March 2021, 7:14 pm EST

    Hi Avnish,

    Thank you for your kind reply.

    I will try it by referring to the source you sent me!
    Thank you very much :D

    Regards.
    YUN
Need extra support?

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

Learn More

Forum Channels