ReoGrid Forum

Fast and powerful .NET Spreadsheet Component

You are not logged in.

Announcement

This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.

https://github.com/unvell/ReoGrid/issues

#1 2017-02-22 22:10:33

ReoGridUser1222
Member
Registered: 2017-02-02
Posts: 4

Selection Range Changed Event Issue. (Solved)

In my program I have picked up the selection range changed event to update a personal Formula Bar.  I ran into an issue when I would use the Enter or Tab key to move to another cell.  The event fired just fine when I moved to the new cell,  but when I moved back to the cell I just left, <using a mouse click>, it would not trigger/fire the selection range changed event.  This is a very isolated bug.  You have to perform these steps in a precise arrangement as described above.  I could not replicate this behavior with any other method.  I dug into the code and found that a function may have not been working as intended because incorrect information was being provided to it.  The function that seemed to be having problems was in the CellsViewPort.cs file.

The misbehaving function:
public override bool OnMouseUp(Point location, MouseButtons buttons)

Line:1176
The following conditional statement was failing when it should have been true.

if (sheet.lastChangedSelectionRange != sheet.selectionRange)

Solution Below:


WARNING!!!!  This has not been thoroughly tested and should remain in development until an exhaustive effort can be made to address all implications.

File location: ReoGrid-master\ReoGrid\Core\Worksheet\selection.cs
Lines: 661-662

661            this.lastChangedSelectionRange = this.selectionRange;  //I Added this line. 
662             this.selectionRange = range;


Regards,
Mark

Offline

#2 2017-02-23 13:24:11

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: Selection Range Changed Event Issue. (Solved)

Thanks Mark!

Offline

Board footer

Powered by FluxBB