Multiselect when .HorizontalScrollBarHeight = 0;

Posted by: todo on 8 September 2017, 12:34 pm EST

  • Posted 8 September 2017, 12:34 pm EST

    I have created a project, added a spread and the code:

    <FONT size=2>InitializeComponent(); //AutoAdded
    fpSpread1_Sheet1.ColumnHeader.Visible = </FONT><FONT color=#0000ff size=2>false</FONT><FONT size=2>;
    </FONT><FONT size=2>fpSpread1_Sheet1.RowHeader.Visible = </FONT><FONT color=#0000ff size=2>false</FONT><FONT size=2>;
    </FONT><FONT size=2>fpSpread1_Sheet1.ColumnCount = 2;
    fpSpread1_Sheet1.RowCount = 0;
    fpSpread1_Sheet1.SelectionUnit = </FONT><FONT color=#2b91af size=2>SelectionUnit</FONT><FONT size=2>.Row;
    fpSpread1.HorizontalScrollBarHeight = 0; //Can not reporduce prior to adding this!</FONT>

    <FONT size=2>When running this project, multiselect rows by click and drag with mouse, passing the top or buttom of spread control I get:</FONT>

    System.DivideByZeroException occurred<o:p></o:p>

    <SPAN>  </SPAN>Message="Attempted to divide by zero."<o:p></o:p>

    <SPAN>  </SPAN>Source="FarPoint.Win.Spread"<o:p></o:p>

    <SPAN>  </SPAN>StackTrace:<o:p></o:p>

    <SPAN>       </SPAN>at FarPoint.Win.Spread.SpreadView.a(Object A_0, EventArgs A_1)<o:p></o:p>

    <SPAN>       </SPAN>at System.Windows.Forms.Timer.OnTick(EventArgs e)<o:p></o:p>

    <SPAN>  </SPAN><SPAN>     </SPAN>at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)<o:p></o:p>

    <SPAN>       </SPAN>at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)<o:p></o:p>

    <SPAN>       </SPAN>at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)<o:p></o:p>

    <SPAN>       </SPAN>at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)<o:p></o:p>

    <SPAN>       </SPAN>at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)<o:p></o:p>

    <SPAN>       </SPAN>at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)<o:p></o:p>

    <SPAN>       </SPAN>at System.Windows.Forms.Application.Run(Form mainForm)

           at MYCode.Main....


    Thankful for your help,


  • Replied 8 September 2017, 12:34 pm EST


    I am not able to reproduce this issue. Make sure you are using the latest maintenance release (2.5.x010). If you are could you post a small zipped project reproducing this issue for us to debug the problem?

  • Replied 8 September 2017, 12:34 pm EST

    Hi again,

    .HorizontalScrollBarHeight = 0 did not work at all in the latest release but just adding
    <FONT size=2>.HorizontalScrollBarPolicy worked in the version I'm using (2.5.2007.2005).</FONT>

    <FONT size=2>Thanks and regards,
    ToDo</FONT><FONT size=2>

  • Replied 8 September 2017, 12:34 pm EST


    It turns out this was a bug in the Spread for Windows forms product that has now been fixed. You can not set the HorizonatalScrollBarHeight to 0. The correct way to get rid of the scrollbar is what you are now doing by setting the HorizontalScrollBarPolicy property.

Need extra support?

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

Learn More

Forum Channels