Jump to content


Photo

Something's wrong with ClearRows


  • Please log in to reply
1 reply to this topic

#1 Mountain

Mountain
  • Members
  • 8 posts

Posted 04 August 2021 - 01:30 PM

Hi!

 

Hope you are having a lovely summer.

 

I have created a small demo application (attached) to illustrate what happens.

Here's a grid with 15 rows:

Attached File  Image1.jpg   18.23KB   2 downloads

 

Case 1) Pressing button "New" clears the content of the grid, but the cell remains focused and active after ClearRows.

Attached File  Image2.jpg   10.91KB   0 downloads

 

Case 2) Pressing button "Load" clears the grid and then loads a file. Just like before, the cell is still active and In addition if the loaded grid has fewer rows none of them can be focused.

Attached File  Image3.jpg   14.38KB   0 downloads

 

Writing this far I realise the problem only seems to happen while a cell is being edited, so I tried calling EndEditing() before ClearRows() and that helps. As a  previous workarund I did:

SelectedRow := -1;
SelectedCol := -1;
ClearRows;
 
Can you please add EndEditing() as the first line of ClearRows() in the official sourcecode? Or could that have other consequences? Perhaps you kow a better way to solve the problem? Maybe a new procedure EndEditingAndClearRows(). ;-)

Attached Files



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 04 August 2021 - 07:36 PM

Hello,

 

I will add this fix for upcoming release. Thank you for reporting.


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users