Jump to content


Photo

OnCellClick treats CheckBox click completely opposite in NG5 NG6


  • Please log in to reply
2 replies to this topic

#1 BelangerC

BelangerC

    Senior Member

  • Members
  • PipPip
  • 221 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 29 August 2023 - 06:03 AM

Hi, Boki and other users who wish to convert NG5 to NG6:

 

In NextGrid5 OnCellClick when used with a NxCheckBox sees the boolean state as FALSE, whereas NextGrid6 sees the CheckBox boolean state as TRUE when clicking on the cell that is visually unchecked.

 

Example from my code:

 

 IF (Columns[ACol] IS TNxCheckBoxColumn) AND
        ((Pos('INDICATED', UpperCase(Columns[ACol].Header.Caption)) > 0) OR
        (Pos('INDCT''D', UpperCase(Columns[ACol].Header.Caption)) > 0)) AND
        Cell[ACol, ARow].AsBoolean THEN
 
The intent is to then delete all cells in the row when UNCHECKING the Indicated column.
 
In NextGrid5 it works for the above code; in NextGrid6, I had to add "not" to "Cell[ACol, ARow].AsBoolean THEN" for it to work.
 
Chuck


#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 29 August 2023 - 03:39 PM

Hi Chuck,

 

Have you tried using this event http://help.bergsoft...nCheckedChanged instead? Maybe is the better place for that kind of operation.


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.

#3 BelangerC

BelangerC

    Senior Member

  • Members
  • PipPip
  • 221 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 01 September 2023 - 01:17 AM

Thank you for the tip, Boki.

I tried that and it certainly seems the best event for what I was trying to do. When using it though, it actually changed the behavior of a form I pop up when clicking on a grid cell expecting a value. This form is a vernier which allows for quick visual value selection 1-1000 and it ceases to function. I have no idea why using this OnCheckedChanged event would do that, but since I got everything to function by using the OnCellClick event by simply reversing the logic test for checked state (actually cell.asBoolean), I have decided not to use your suggestion. Nor did I trace why simply changing that event, which only deals with the checked columns, not the cells for accepting a value, would affect the Vernier form. 

 

I doubt if this is a bug in NextGrid6, just some logic issue in my code.

Chuck






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users