Scroll problems

Posted by: dror_farhi on 6 November 2018, 11:20 pm EST

  • Posted 6 November 2018, 11:20 pm EST - Updated 30 September 2022, 3:08 am EST

    Hi,

    I have an active x control that I am using on vb6:

    We currently updated this control from vaSpread version: 2.5.0.1, to the new fpSpread version 8.0.28.

    When there are 8 columns (the number of VisibleCols), the horizontal scroll still appears:

    Why the scroll appears if the columns are fit to the grid width ?

    When I click between the horizontal scroll and it’s arrow - here:

    I’m getting an unexpected result:

    The first column: “Inj #” that we are still see is FrozenCol.

    How can I fix this problem and get rid of the gray area ?

    Thanks,

    Dror Farhi

  • Posted 8 November 2018, 12:17 am EST

    Hello,

    You would need to set the ‘ScrollBarMaxAlign’ property to true to avoid scrolling till the last column becomes left column.

    Thanks,

    Deepak Sharma

  • Posted 8 November 2018, 1:23 am EST

    Hi,

    ScrollBarMaxAlign already set to True, and the left column after scrolling: “Inj #” is not the last column, it is the first column, but it is a ColFrozen column.

    If I’m commenting the line of making “Inj #” as ColFrozen, all the grid becomes gray when clicking between the scroll to it’s arrow.

    Thanks,

    Dror Farhi

  • Posted 8 November 2018, 6:31 pm EST

    Hi Dror,

    Please provide me your sample application to test this issue. With your requirements I have got following information

    1. You do not want the scrollbar to show in beginning.
    2. When columns are added the scroll bar should show.
    3. The gray area seen when scrolling should be minimum.

    If the above points are correct, please provide me your application, I will test it further for the above mentioned points.

    Thanks,

    Deepak Sharma

  • Posted 10 November 2018, 7:34 pm EST - Updated 30 September 2022, 3:08 am EST

    Hi,

    There are 2 problems with the scroll:

    1. Horizontal scroll appears, even when sum of columns width is smaller than grid width.
    2. When you are clicking between the horizontal scroll an it’s right arrow, all the columns disappear except of the first column: “aaaaa” - a ColFrozen column:

    Thanks,

    Dror Farhi

    scroll exists.zip

  • Posted 12 November 2018, 10:41 pm EST

    Hello,

    1. In you code you have not set ScrollBars to ‘none’ or just ScrollBarsVertical. I have set to show only vertical scrollbar only.
    2. Since there is no horizontal scroll bar we can not reproduce this issue.

    Please refer to the attached sample.

    Thanks,

    Deepak Sharmascroll exists.zip

  • Posted 13 November 2018, 1:57 am EST

    Hi,

    We suppose to have horizontal scroll bar in the grid when the sum of columns width is bigger than the grid width (Number of columns is bigger than VisibleCols) !!!

    We don’t suppose to have horizontal scroll bar in the grid when the sum of columns width is smaller than the grid width (number of columns is equal or smaller than VisibleCols) !!!

    That’s why we have: ScrollBarExtMode = True on design !!!

    The sample application I gave you is only a state when sum of column width is smaller than grid width, and we don’t suppose to see the scroll, but it is still exists !!!

    But even in the sample you returned, you can see that the last column header suppose to be: “A1c (mmol/mol IFCC)”, and we still cannot see this column !!!

    Your solution eliminates the scroll all the time, so what’s the meaning of: ScrollBarExtMode = True ???

    Thanks,

    Dror Farhi

  • Posted 13 November 2018, 11:15 pm EST

    Hello Dror,

    In the sample application which I sent to you in my last post works like as you said.

    Initially it has all the columns visible and there is no scrollbar.

    When you add more columns the width of the Spread control increases as per the code used.

    Please test it and let me know if it does not work.

    Thanks,

    Deepak Sharma

  • Posted 13 November 2018, 11:39 pm EST

    Hi,

    I tested it, and even without adding columns, you can run the code and see that “A1c (mmol/mol IFCC)” column isn’t showed and there is no scroll, so the grid doesn’t have all columns visible !!!

    Why didn’t you gibe me an answer about ScrollBarExtMode = True, If I have it, I don’t need to do:

    sprdSample.ScrollBars = ScrollBarsVertical, because this property suppose to show scroll if there isn’t enough space for columns, or to not show the scroll if there is enough space.

    Thanks,

    Dror Farhi

  • Posted 15 November 2018, 1:51 am EST

    Hello Dror,

    I understand your requirement as following:

    1. You do not want scrollbar initially and but the columns to visible.
    2. When new columns added Spread should resize automatically. Please confirm if you want the scrollbar to appear in this case?
    3. You do not want the grey area to appear.

    Please confirm above requirements.

    Thanks,

    Deepak Sharma

  • Posted 15 November 2018, 4:08 am EST

    Hi,

    1. Actually, I don’t know what happens initially. The sample example I sent you is only a state, where initially number of columns is <= VisibleCols, so the grid width is bigger than the sum of columns width, so there is no need for scroll. The columns are coming from the DB, so in other cases the number of columns can be >= VisibleCols, so the grid width is smaller than the sum of columns width, and we will see the scroll initially - On this case the application works fine. I sent you the state where there is a problem with the application:

      number of columns is <= VisibleCols, so the grid width is bigger than the sum of columns width, and the scroll shouldn’t appear as I understand from: ScrollBarExtMode = True, but it still appears with no use.
    2. When new columns added, the grid suppose to keep it’s width (No Resize !!), but if the width isn’t big enough for sum of columns width, the scroll should appear.
    3. If you’ll click in the application I sent you between the scroll and it’s arrow (The area is smaller than 1 millimeter), you will see that all the columns disappear except of the first column: a frozen column. This behavior will be resolved if the unused scroll will not appear.

    Thanks,

    Dror Farhi

  • Posted 16 November 2018, 1:49 am EST

    Hi Dror,

    Thanks for confirmation, I will work on the sample with the above features and get back to you soon.

    Thanks,

    Deepak Sharma

  • Posted 18 November 2018, 7:19 pm EST

    Hello,

    I have created a sample application which works for both 1 & 2.

    It does not show any scrollbar when Spread is loaded and also shows all columns.

    On adding columns it shows the scrollbar.

    Since there is no scrollbar, the issue mentioned in 3 is not reproducible.

    Thanks,

    Deepak SharmaSpreadCOmScrollBarCustom.zip

  • Posted 20 November 2018, 2:04 am EST

    Hi,

    It’s not an elegant solution, and I still don’t understand why ScrollBarExtMode = True works fine for vertical scroll and need this ugly patch for horizontal scroll, but it works.

    Thanks for your help

    Dror Farhi

  • Posted 21 November 2018, 1:34 am EST

    Hi,

    Another question:

    To improve performance:

    Can I run, in order to sum columns width:

    for i = 1 To fpSpread1.DataColCnt

    instead of:

    for i = 1 To fpSpread1.MaxCols

    ?

    Cause we can have MaxCols = 500, but DataColCnt = 40

    Thanks,

    Dror Farhi

  • Posted 21 November 2018, 4:03 pm EST

    Hi Dror,

    ScrollBarExtMode is working absolutely fine. Please check the sample attached. It does not show the horizontal scrollbar initially but when another column is added and that column is out of view the horizontal scrollbar appears correctly.

    This is the default functionality ‘ScrollBarExtMode’ property.

    Also answer to your last question is yes, you can run the loop for Data columns only instead of MaxCols.

    Thanks,

    Deepak Sharma

    SpreadCOmScrollBarExtMode.zip

  • Posted 21 November 2018, 7:33 pm EST

    Hi,

    So why in our previous sample we needed to sum columns width ?

    What’s the difference between the 2 samples ?

    And why in the previous sample we don’t need to sum rows height ?

    Obviously I still don’t understand the meaning of the property: ScrollBarExtMode

    Thanks,

    Dror Farhi

  • Posted 25 November 2018, 7:41 pm EST

    Hello,

    The sample provided to you earlier caters the issue when we do not want to show the scrollbar and the width of the columns is more than the width of Spread control. We had set the Scrollbars value to ‘None’ in first sample application.

    And we needed to adjust the width of the spread control so we can view all the columns also take care of the issue when new columns are added.

    Taken from documentation:

    When the ScrollBarExtMode property is set to True, the application hides the scroll bars when the maximum number of rows or columns fit in the control boundaries. When the ScrollBarExtMode property is set to False, the application displays the scroll bars at all times.

    The ScrollBarExtMode property does not have an effect unless the ScrollBars property is set to a value other than 0 (None).

    We have to set the ScrollBars property to Vertical/Horizontal/Both in order to have ScrollBarExtMode working.

    As tested in the application I provided to you in my last post, this property is working as per the requirement.

    Please let me know if you have any issues unresolved.

    Thanks,

    Deepak Sharma

  • Posted 25 November 2018, 11:16 pm EST

    Hi,

    so why on this example we still see the scroll when

    ScrollBarExtMode = True

    ScrollBars = 3 'ScrollBarsBoth ?

    Thanks,

    Dror Farhi

    scroll exists.zip

  • Posted 25 November 2018, 11:23 pm EST

    I forgot to mention:

    and

    The width of the columns is less than the grid width.

    You can even change the width of the last column: “A1c (mmol/mol IFCC)” from 14 to 7, so you will see in your eyes that the width of the columns is smaller than the grid width, but still the scroll appears

  • Posted 26 November 2018, 9:20 pm EST

    Hi Dror,

    There is redundancy in your sample code. I tried to remove the repetition in your code and got rid of the issue. You had set MaxCols and MaxRows many times.

    Now I have set the ScrollBarExtMode in your sample and got it working absolutely fine.

    It currently does not show the horizontal scrollbar at the beginning and shows when new columns are inserted.

    Please check the attached sample.

    Thanks,

    Deepak SharmaScrollIssueScrollExtMode_Modified.zip

  • Posted 27 November 2018, 12:07 am EST - Updated 30 September 2022, 3:08 am EST

    Hi,

    you are right about the redundancy and repetition. It’s inside my code, cause I had to isolate the code from my application. But this is not the problem. The problem is:

    AutoSize = True

    when I add it to the last sample you send me, you can see that the scroll appears even when sum of columns width is smaller than grid width.

    So now it seems that I don’t need the ugly calculation of column width.

    But now the problem is that when there are a few columns, the grid is bigger than the columns (I attached a picture).

    Is there a way to solve it ?

    Or I need to stay with the ugly calculation

    Thanks,

    Dror Farhi

  • Posted 4 December 2018, 8:10 pm EST

    Hi,

    OK, I’ll stay with the calculation of columns width.

    Thanks for your help.

    Dror Farhi

  • Posted 10 December 2018, 12:16 am EST

    Hi Dror,

    We are back to where we started. I provided you the work-around to adjust the Spread’s width as per the columns width to cater this problem only. here:

    https://www.grapecity.com/en/forums/spread-com/there-is-no-scroll-when-we#paginate-2

    I don’t think there is another way to handle this issue.

    Thanks,

    Deepak Sharma

  • Posted 10 December 2018, 9:18 pm EST

    Hi Dror,

    We were in discussion with the development team about this issue and found out that the Autosize will work correctly however Spread control needs to wait to completely repaint and autosize. We got a work-around for this issue implemented in the attached sample application, please refer to the same.

    Hope it helps!

    Thanks,

    Deepak SharmaScrollBarExtMode_workaround.zip

Need extra support?

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

Learn More

Forum Channels