Multiselect when .HorizontalScrollBarHeight = 0;

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

  • Posted 8 September 2017, 12:34 pm EST

    <P>Hi,<BR>I have created a project, added a spread and the code:</P>
    <P><FONT size=2>InitializeComponent(); //AutoAdded<BR>fpSpread1_Sheet1.ColumnHeader.Visible = </FONT><FONT color=#0000ff size=2>false</FONT><FONT size=2>;<BR></FONT><FONT size=2>fpSpread1_Sheet1.RowHeader.Visible = </FONT><FONT color=#0000ff size=2>false</FONT><FONT size=2>;<BR></FONT><FONT size=2>fpSpread1_Sheet1.ColumnCount = 2;<BR>fpSpread1_Sheet1.RowCount = 0;<BR>fpSpread1_Sheet1.Rows.Add(0,3);<BR>fpSpread1_Sheet1.SelectionUnit = </FONT><FONT color=#2b91af size=2>SelectionUnit</FONT><FONT size=2>.Row;<BR>fpSpread1.HorizontalScrollBarHeight = 0; //Can not reporduce prior to adding this!</FONT></P>
    <P><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></P>
    <P class=MsoNormal>System.DivideByZeroException occurred<o:p></o:p></P>
    <P class=MsoNormal><SPAN>  </SPAN>Message="Attempted to divide by zero."<o:p></o:p></P>
    <P class=MsoNormal><SPAN>  </SPAN>Source="FarPoint.Win.Spread"<o:p></o:p></P>
    <P class=MsoNormal><SPAN>  </SPAN>StackTrace:<o:p></o:p></P>
    <P class=MsoNormal><SPAN>       </SPAN>at FarPoint.Win.Spread.SpreadView.a(Object A_0, EventArgs A_1)<o:p></o:p></P>
    <P class=MsoNormal><SPAN>       </SPAN>at System.Windows.Forms.Timer.OnTick(EventArgs e)<o:p></o:p></P>
    <P class=MsoNormal><SPAN>  </SPAN><SPAN>     </SPAN>at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)<o:p></o:p></P>
    <P class=MsoNormal><SPAN>       </SPAN>at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)<o:p></o:p></P>
    <P class=MsoNormal><SPAN>       </SPAN>at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)<o:p></o:p></P>
    <P class=MsoNormal><SPAN>       </SPAN>at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)<o:p></o:p></P>
    <P class=MsoNormal><SPAN>       </SPAN>at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)<o:p></o:p></P>
    <P class=MsoNormal><SPAN>       </SPAN>at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)<o:p></o:p></P>
    <P class=MsoNormal><SPAN>       </SPAN>at System.Windows.Forms.Application.Run(Form mainForm)</P>
    <P class=MsoNormal>       at MYCode.Main....</P>
    <P class=MsoNormal> </P>
    <P class=MsoNormal>Thankful for your help,</P>
    <P class=MsoNormal>ToDo</P>
  • Replied 8 September 2017, 12:34 pm EST

    <P>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?</P>
  • Replied 8 September 2017, 12:34 pm EST

    <P>Hi again,</P>
    <P>.HorizontalScrollBarHeight = 0 did not work at all in the latest release but just adding<BR><FONT size=2>.HorizontalScrollBarPolicy worked in the version I'm using (2.5.2007.2005).</FONT></P>
    <P><FONT size=2>Thanks and regards,<BR>ToDo</FONT><FONT size=2></P></FONT>
  • Replied 8 September 2017, 12:34 pm EST

    <P>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.</P>
Need extra support?

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

Learn More

Forum Channels