Jump to content


Photo

Converting NG5 to NG6: Event substitutions summary


  • Please log in to reply
5 replies to this topic

#1 BelangerC

BelangerC

    Senior Member

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

Posted 22 June 2023 - 12:42 PM

Hello all:

 

Thought you might like to see a summary of what I have learned as far as the NG6 equivalent events when converting NG5 to NG6.

HTH,

Chuck

 

Grid5 to Grid6
Events:
5 = 6
OnAfterEdit = GridView2AfterEdit
OnApplyEditText = no comparable event in NG6
OnBeforeEdit = GridView2BeforeEdit
OnBeforeSelect = GridView2BeforeSelect; OnSelectQuery (allows ACCEPT)
OnCellClick = GridView2CellClick
OnCellColoring = NxReportGridView61.NxReportGridView61GetCellColor
OnCellDblClick = GridView2CellDblClick
OnCellFormating = NxTextColumn61StyleText (apply to text related/subclassed columns)
OnCellHint = NxCheckBoxCol61GetHint; (only CheckBox columns)
OnChange = OnCellChange;
OnColumnResize = Each Column has OnResize, e.g. NxTextColumn61Resize as routine for all.
OnEditText = OnAcceptEdit (best for the actual code, i.e. to catch and truncate long entries before saving to DB)
OnExpand = OnRowExpand;
OnHeaderClick = Columns.OnHeaderClick(Do not use; no Column param);instead use NxReportGridView61.OnHeaderMouseDown (ssSingle)
OnHeaderDblClick = Use NxReportGridView61.OnHeaderMouseDown (ssDouble)
OnKeyDown = GridView2KeyDown
OnKeyUp = GridView2KeyUp
OnMouseMove = GridView1MouseMove
OnSelectCell = GridView2Select
OnVerticalScroll = GridView2VerticalScroll


#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 01 July 2023 - 01:05 PM

Hello Chuck,

 

This is pretty good comparison. Maybe I can put it on my help page, if you agree.

 

PS. Does OnAcceptEdit can help for OnApplyEditText?


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 21 August 2023 - 05:41 PM

Hi, Boki:

Yes, please feel free to use this list. That was the idea of posting it for you or others facing the same conversion process.

 

Also, the code i had in my NG5 OnApplyEditText was:

 

Since there does not seem to be a Editor property for NG6, not sure how to achieve the intent in NG6. BTW, this is not a major issue if I can't do this code.

 

 WITH GridView1.Columns[ACol].Editor DO
  BEGIN
    Color := clYellow;
    Font.Color := clBlack;
    Font.Style := [fsBold];
  END;


#4 BelangerC

BelangerC

    Senior Member

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

Posted 28 November 2023 - 09:13 PM

Hi, All:

 

This conversion OnHeaderDblClick = Use NxReportGridView61.OnHeaderMouseDown (ssDouble) DOES NOT WORK.  As far as I can determine, there is no way to get a HeaderDblClick-like event. ssDouble does not appear to be recognized by the OnHeaderMouseDown event. I ended up having to use a right mouse event instead which is somewhat problematic because users have been using dbl click.

 

It would be nice, Boki, to add some way (i.e. have event recognize the ssDouble, or an actual DblClick event) to have a double click event for the header.

 

Thank you,

Chuck



#5 BelangerC

BelangerC

    Senior Member

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

Posted 05 December 2023 - 05:44 PM

Hi, All:

 

After a LOT OF WORK and TIME, I will be abandoning my efforts to convert the use of current NextGrid 5 use to NextGrid 6.

 

For simple projects this conversion may work and certainly for new projects, one should use NG6, but for complex grids (Treed grids which are created from a database with stored grid property data, allow the user to add rows of data, single or multiple rows at a time, popup windows in various columns), there are just too many differences between the two components to be able to program around the differences allowing the same functionality and with the same expected behavior.

 

There are weird bugs which have been very difficult to trace, sometimes intermittent which essentially crash my program and require the user to restart. The worst appear to be occurring after adding child rows during run time: the grid will redraw with parts of the grid missing; the scroll bar will be missing meaning that the added rows are not even accessible; row parents will become collapsed even though the program does not call for that behavior, i.e. the parent rows should be expanded to reveal the added child rows. On close of the grid and reopening, everything appears correctly, but this closing and reopening the grid, which recreates the grid, is just too much to expect from the user, who is typically in a clinical situation with a client.

 

I wrote the code to allow easy user selection of which NextGrid to use, so that will not be a problem to revert back to NG5.

 

I hope others can use my posts to help them make any conversions in their own programs. I was hoping to leave my program with it using the more up-to-date NG6 component as I prepare to retire in the next few months. They are moving the application to a cloud based one which makes sense for them. (Distributing databases which have common and user specific data to users is a major overhead when doing updates. A single cloud based DB will, among other issues, simplify support and maintenance. When I started this project 20 years ago, fast cloud based databases simply did not exist. At that time programs with quick response and complicated user interfaces required local databases and applications.)

 

Best regards,

Chuck



#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 05 December 2023 - 06:42 PM

Hello Chuck,

 

I’m sorry that it didn’t worked. I hope that your guide will help others at least.

 

I wanted to make automatic converter, but it was not easy to do. Unfortunately version 6 needed to be rewritten from scratch as older versions were really hard to extend and maintain.


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