GridDesktop: mouse wheel scrolling adds rows, deletion of sheets

See attached sample: start it, click the button, and a new Aspose.Cells workbook is created and shown in GridDesktop in readonly mode.
GridDesktopTest.zip (5.2 KB)

Problem 1:
Switch to “Sheet 1”, then use the mouse wheel to scroll down. Additional blank rows will appear in the grid.

Problem 2:
Switch to “Sheet 1”, and in the worksheet tab bar, do a right click and call “Delete” (which should not be available anyway, as I opened the file read only).
The deleted sheet is still visible. It disappears from the tab bar if you hover with the mouse over it, but the sheet content is still shown.

Problem 3:
A crash will happen if you delete the last sheet. Doing this is not reasonable, but it is possible ;-).

Best regards

Wolfgang

@wknauf

It seems you are encountering several issues with the Aspose.Cells GridDesktop component. Let’s address each of your problems one by one:

Problem 1: Mouse Wheel Scrolling Adds Rows

The issue of additional blank rows appearing when scrolling with the mouse wheel may be related to how the GridDesktop handles rendering and scrolling. This behavior can sometimes occur in read-only mode if the control is not properly managing the view state. To troubleshoot this, ensure that you are using the latest version of Aspose.Cells, as updates often include bug fixes and improvements. If the problem persists, consider reporting it to Aspose support for further investigation.

Problem 2: Deleting Sheets in Read-Only Mode

You mentioned that you can right-click on a worksheet tab and select “Delete,” even though the workbook is opened in read-only mode. This should not be possible, as the delete functionality should be disabled in read-only mode. It appears that the UI is not correctly enforcing this restriction. You may want to check the settings or properties of the GridDesktop control to ensure that it is configured to prevent modifications in read-only mode. If the issue continues, it would be advisable to report this behavior to Aspose for a potential fix.

Problem 3: Crash When Deleting the Last Sheet

The crash occurring when attempting to delete the last sheet is indeed a critical issue. This behavior is not expected and indicates a potential bug in the GridDesktop component. It is important to avoid such operations in production environments until a fix is provided. Please report this crash to Aspose support, including details about your environment and steps to reproduce the issue, so they can address it in future updates.

Recommendations

  • Ensure you are using the latest version of Aspose.Cells.
  • Review the documentation for any settings related to read-only mode and sheet management.
  • Report the issues to Aspose support for further assistance and potential fixes.

If you have any further questions or need additional assistance, feel free to ask!

@wknauf,

Thanks for the details and sample app.

After initial testing, I am able to reproduce all your mentioned three issues.
For the problems:

Problem 1:
Switch to “Sheet 1”, then use the mouse wheel to scroll down. Additional blank rows will appear in the grid.

May be it is by design, but it should not do it. We require thorough analysis of the issue.

Problem 3:
A crash will happen if you delete the last sheet. Doing this is not reasonable, but it is possible ;-)

Since you are removing the evaluation watermark sheet, so the error occurred as you cannot remove evaluation watermark sheet in evaluation mode (limit). Maybe we should not throw any error at least. We need to evaluate the issue in details.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s):

  • CELLSNET-58338 - When using mouse wheel to scroll down, additional blank rows will appear in the GridDesktop
  • CELLSNET-58339 - When deleting a sheet via right-click menu option “Delete”, sheet data is still visible in GridDesktop
  • CELLSNET-58340 - A crash or error will happen if you delete the last sheet from the GridDesktop

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

About problem 1:
When the grid is in edit mode, the mouse wheel behavior might make sense, otherwise it would not be possible to add rows to the grid. But in my use case, the grid is read only, so it is feels wrong that additional rows are added.

Even if the grid is in edit mode, the behavior is strange. Excel itself displays some kind of endless grid, where you can scroll in all directions and reach new rows/cols. GridDesktop does not allow to add cols to the right of the grid, the context menu item “Insert col” does not allow adding a col after the last col. Same for “Insert row”. Maybe it would help to add rows/cols if cursor right/down keys are pressed?

If you want to simulate the Excel behavior, maybe you should fill the visible area with additional rows/cols so that GridDesktop displays empty cells in the full visible screen area.

What do you think? But as I wrote: my use case is a read only grid, so no requirement to improve this. But if would be nice if you could remove the adding of rows in read only mode when using the mouse wheel ;-).

Bonus problem:
The grid context menu separators are menu items with text “-”:
contextmenu.png (4.9 KB)

About Problem 3:
I added our license to the sample so that it does not display any license sheets. The error when removing the single sheet still happens (it only happens if you click somewhere inside the sheet data, that is still visible though removed):

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
   at System.Collections.ArrayList.get_Item(Int32 index)
   at Aspose.Cells.GridDesktop.WorksheetCollection.(Int32 )
   at Aspose.Cells.GridDesktop.WorksheetCollection.get_Item(Int32 index)
   at Aspose.Cells.GridDesktop.GridDesktop.GetActiveWorksheet()
   at Aspose.Cells.GridDesktop.Worksheet.SetFirstVisibleColumn(Int32 col)
   at Aspose.Cells.GridDesktop.GridDesktop.(Int32 , Boolean )
   at Aspose.Cells.GridDesktop.GridDesktop.(Int32 )
   at Aspose.Cells.GridDesktop.GridDesktop.(Int32 , Int32 )
   at Aspose.Cells.GridDesktop.GridDesktop.(Worksheet , Int32 , Int32 , Boolean )
   at Aspose.Cells.GridDesktop.GridDesktop.(Worksheet , Int32 , Int32 )
   at Aspose.Cells.GridDesktop.GridDesktop.OnMouseDown(MouseEventArgs e)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(HWND hWnd, MessageId msg, WPARAM wparam, LPARAM lparam)

Best regards

Wolfgang

@wknauf
About problem 1:
your suggestion is correct.we will improve it.

for the Bonus problem:
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-58346

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

About Problem 3 :
thanks for your furthur investigation ,we will fix it .

Just for the records: there should be an older ticket to disable the “Add sheet/Delete sheet” context menu in read only mode: GridDesktop: readonly grid - #7 by amjad.sahi

@wknauf

Just for the records: there should be an older ticket to disable the “Add sheet/Delete sheet” context menu in read only mode: GridDesktop: readonly grid - #7 by amjad.sahi

ok,we will fix it in the v25.5 release.

@wknauf,

We are pleased to inform you that your issues (Ticket IDs: CELLSNET-58338, CELLSNET-58339, CELLSNET-58340 and CELLSNET-58346) have been resolved. The fixes/enhancements will be included in an upcoming release (Aspose.Cells.GridDesktop v25.5) that we plan to release either this week or in the next week of May 2025. You will be notified when the next version is released.

@wknauf
The issues you have found earlier (Ticket IDs: CELLSNET-58338, CELLSNET-58339, CELLSNET-58340 and CELLSNET-58346) have been fixed in this v25.5 release.

I can confirm that most of the issues are fixed now, many thanks!

Problem 3 still happens: I can confirm that you can no longer delete the license warning sheet, but I added a valid license to my sample and can reproduce the error when deleting the last sheet:

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at .(Int32 )
   at Aspose.Cells.GridDesktop.WorksheetCollection.RemoveAt(Int32 index)
   at .(Object , EventArgs )
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(HWND hWnd, MessageId msg, WPARAM wparam, LPARAM lparam)

This issue does not affect me as I want to use GridDesktop only in read only mode, but it might be relevant for other customers of you.

@wknauf
Thanks for your suggestion.
We can reproduce this issue.
We’ve reopened CELLSNET-58340
We will fix it soon.

@wknauf,

This is to inform you that your issue (Ticket ID: “CELLSNET-58340”) has been resolved precisely now. The fix/enhancement will be included in an upcoming release (Aspose.Cells.GridDesktop v25.6) that we plan to release in the first half of June 2025. You will be notified when the next version is released.

@wknauf
The issues you have found earlier (filed as CELLSNET-58340) have been fixed in this update.

Sorry to bring this back again - but if I open a xslx file with 25.6 in default mode (not read only), I cannot bring back the sheet bar context menu. If I did not click any cell before, no context menu is shown at all. After selecting a cell, the cell context menu is also shown in the sheet bar. But I cannot find the context menu which allows adding or deleting of sheets.

So, I cannot even verify whether the fix works ;-).

I added licensing code to the sample (commented in “Program.cs”), but removed my license file. So, you would have to add a “Aspose.Cells.lic” file to the project and switch the type to “Embedded resource” to use the license.
GridDesktopTest_25.6.zip (5.3 KB)

@wknauf
We can reproduce the issue in your project. we will investigate it soon.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-58597

The sheet bar context menu does not show

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@wknauf,

We are pleased to inform you that your issue (Ticket ID: “CELLSNET-58597”) has been resolved. We have fixed the issue where the sheet bar context menu was not showing. The fix/enhancement will be included in the upcoming release (Aspose.Cells.GridDesktop v25.7) that we plan to release before the end of this week of July 2025. You will be notified when the next version is published.

The issues you have found earlier (filed as CELLSNET-58597) have been fixed in GridDesktop v25.7. This message was posted using Bugs notification tool by leoluo

Thanks, I can confirm that the tab context menu is back again if the grid is not read only.

@wknauf
Alright, that’s perfectly fine. Should you have any additional questions or feedback, please don’t hesitate to reach out to us again.