Filter buttons are not hidden when a column is hidden
Workaround in the attached project.
Steps to reproduce:
1. Handle the MessageShowing event like this:
private void SpreadsheetElement_MessageShowing(object sender, Telerik.WinForms.Controls.Spreadsheet.MessageShowingEventArgs e)
{
e.IsHandled = true;
}
2. Protect the Workbook
3. Start the app and paste with the context menu
Actual: A dialog is shown
Right-click an empty cell and select Copy.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.ArgumentNullException: Value cannot be null.
Parameter name: text
at System.Windows.Forms.Clipboard.SetText(String text, TextDataFormat format)
at System.Windows.Forms.Clipboard.SetText(String text)
at Telerik.WinForms.Controls.Spreadsheet.Clipboards.ClipboardEx.MSClipboardSetText(String text)
at Telerik.WinForms.Controls.Spreadsheet.Clipboards.ClipboardEx.SetTextInternal(String text)
at Telerik.WinForms.Controls.Spreadsheet.Clipboards.ClipboardEx.SetDataInternal(String text, WorksheetFragment fragment)
at Telerik.WinForms.Controls.Spreadsheet.Worksheets.RadWorksheetEditor.Copy()
at Telerik.WinForms.Controls.Spreadsheet.Worksheets.RadWorksheetEditorCommands.<>c.<InitializeCommands>b__575_94(RadWorksheetEditor editor, Object parameter)
at Telerik.WinForms.Controls.Spreadsheet.Commands.RadSheetEditorDelegateCommand`1.ExecuteOverride(Object parameter)
at Telerik.WinForms.Controls.Spreadsheet.Commands.RadSheetEditorCommandBase`1.Execute(Object parameter)
at Telerik.WinControls.UI.RadSpreadsheetElement.<CreateDefaultWorkbookContextMenu>b__184_1(Object <p0>, EventArgs <p1>)
at Telerik.WinControls.RadElement.OnClick(EventArgs e)
at Telerik.WinControls.UI.RadButtonItem.OnClick(EventArgs e)
at Telerik.WinControls.UI.RadMenuItem.OnClick(EventArgs e)
at Telerik.WinControls.RadElement.DoClick(EventArgs e)
at Telerik.WinControls.RadElement.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
at Telerik.WinControls.RadElement.DoMouseUp(MouseEventArgs e)
at Telerik.WinControls.ComponentInputBehavior.OnMouseUp(MouseEventArgs e)
at Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at Telerik.WinControls.RadControl.WndProc(Message& m)
at Telerik.WinControls.UI.RadPopupControlBase.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
1.Make the sheet protected
2. Paste using Ctrl+V
The first message shows:
Then:
Hello,
So here's what happens. I create a workbook and a worksheet in that wb which I assign as the workbook of a RadSpreadSheet by RadSpreadSheet..Workbook = wb
The first time I assign a name to the first (and only sheet) created in the creation of the wb, the name does appear on that sheet.
Then some code takes this workbook ByVal, creates a new Sheet, makes that sheet the wb's ActiveWorksheet and then changes the ws's name.
You can see in the debugging that the worksheet does have the new name i put there ("2018-05"), but visually this 2nd worksheet has the default name "sheet 2".
Then that wb which is returned by the function is assigned as the RadSpreadSheet's workbook
If I run the code again, so a 3rd sheet is created, then the 3rd sheet will visually have the default name "sheet 3", however in the debugger it says "2018-06" as its name; but most importantly, now sheet 2 has magically changed to what I was seeing its name to be in the debugger ("2018-05").
I'm assuming that If I'm changing the sheet names at runtime, I need to call some method on the Workbook element or something like that in order to update the names. I just couldn't find which method to call.
Best regards,
Ioannis Mamalikidis.
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); } }