Completed
Last Updated: 30 Jul 2021 12:00 by ADMIN
Release R3 2021
ADMIN
Hristo
Created on: 06 Mar 2018 11:07
Category: Spreadsheet
Type: Bug Report
1
FIX. RadSpreadSheet - the document should be scrolled with the MouseWheel
Workaround: Handle the MouseWheel event of the control

private void RadSpreadsheet1_MouseWheel(object sender, MouseEventArgs e)
{
    int offset = this.radSpreadsheet1.SpreadsheetElement.VerticalScrollBar.SmallChange * 3;
    int x = e.Delta < 0 ? offset : -offset;
    this.radSpreadsheet1.SpreadsheetElement.VerticalScrollBar.ClampValue = true;
    this.radSpreadsheet1.SpreadsheetElement.VerticalScrollBar.Value += x;

    RadWorksheetEditor editor = this.radSpreadsheet1.SpreadsheetElement.ActiveSheetEditor as RadWorksheetEditor;
    if (editor != null)
    {
        IRadWorksheetEditorPresenter presenter = (IRadWorksheetEditorPresenter)editor.GetType().GetField("activePresenter", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(editor);
        presenter.SetVerticalOffset(presenter.VerticalOffset + x);
        editor.InvalidateMeasure(true);
    }
}
0 comments