Jump to content


Photo

Bug with onBeforeEdit ?


  • Please log in to reply
2 replies to this topic

#1 aboisrame

aboisrame
  • Members
  • 17 posts

Posted 09 April 2020 - 03:24 PM

Hello,

 

 first of all, thank you for your great grid I use with pleasure. But last days, I had to fight with a strange bug in a project. 

 

I think I have found an error. With a new VCL project :

 

1) Use a grid on a form. Create a ReportGrid View in the IDE.

 

2) Create some columns and rows with code when you click on a first button. Add onBeforeEdit event for, for example, the first column. 

 

Here, onBeforeEdit method just call showMessage for this simple example. So, when you click anywhere (?) on the grid ... onBeforeEdit is trigged. 

 

3) Clear the grid by code when you click on a second button (grid.clear)

 

4) Create some new columns and rows again by code when you click on a third button. But now, NO onBeforeEdit event for all these new columns.

 

And ... when you click on the grid again, onBeforeEdit is triggered !

 

What is wrong ? What I didn't understand ? 

Thank you for you answer

Have a good day

Alexandre Boisramé

 



#2 aboisrame

aboisrame
  • Members
  • 17 posts

Posted 09 April 2020 - 03:53 PM

I understood ... onBeforeEdit is a event of the grid and not of a columm ... 

 

grid.onBeforeEdit = nil will do what I need. 

 

:)



#3 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 09 April 2020 - 04:07 PM

Hi,

 

Glad that you solved it. I have written nice article about edit events on:

http://developer.ber...=683&lang=en-us

 

Maybe it will help you in the future.


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.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users