Jump to content


Photo

NextGrid5 -> NextGrid6 upgrade


  • Please log in to reply
126 replies to this topic

#1 stefanw

stefanw
  • Members
  • 32 posts

Posted 04 April 2017 - 04:14 PM

Hello Boki,

while updating some existing forms from Nextgrid5 to Nextgrid6 there are some properties missing. Columns.options?
And columns.header.displaymode constants are not stay in NxColumns6 unit. It is correct that we must mix NxColumn unit with NxColumn6 unit?
I use mostly adding columns and rows at runtime.

Can you explain more datails to upgrading from Nextgrid5 to Nextgrid6?

Thank you.

Stefan

 

columns.header.displaymode -> NxClasses6


Edited by stefanw, 04 April 2017 - 04:20 PM.


#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 06 April 2017 - 12:49 AM

Hi,

Most of the types you can find in NxTypes6 and NxClasses6. I was trying to keep them in one place.

Can you tell me which property you need from Options property?

Now I have spread them into own properties for easier usage. For example coEditing is now simply Editing property. You don't need to type anymore:
NextGrid.Columns[x].Options := NextGrid.Columns[x].Options + [coEditing] if you want to enable just editing for some columns (and similar).

Adding rows is mostly the same (there is AddRow method, Cells, Row etc.)
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 stefanw

stefanw
  • Members
  • 32 posts

Posted 07 April 2017 - 06:28 PM

Hello Boki,

 

AppearanceOptions.aoHintmark ??

 

Where is it in Nextgrid 6?

 

Thanks!

Stefan



#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 09 April 2017 - 01:23 AM

Hi,

Not included, but will add it now (it's one property - easy to add).

It will be included in next release (I will re-upload tomorrow).
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.

#5 BelangerC

BelangerC

    Senior Member

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

Posted 18 August 2017 - 12:57 PM

Hi, Boki:

I am just starting a big project update from Delphi XE2 to Delphi 10.1 Berlin and from NextGrid 5 to NextGrid 6.

Do you have any documentation on name, class name, property name, etc changes? 

I figured out that most simply have "6" after the name, but I am finding things I am having a hard time discerning the new name:

1. TNxImageColumn is this now TNxIconColumn6 ?

2. Can't find TCellState, nor the events OnCellFormating, OnCellColoring. I do use them. How do I get the same events or end result?

 

I am just starting and feel that already this is overwhelming to make this conversion. I am sure I will have more questions. Off hand it seems like I cannot rely on having the same properties and events in the equivalent NextGrid6 components. Do you have a way to map everything over?

Thank you,

Chuck Belanger

 



#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 18 August 2017 - 10:07 PM

Hello,

1) Yes, correct. Most of all properties there are the same.

2) You have even better stuff in v6. For example every column include set of events such as OnGetValue, OnGetText.

And also there is OnSetCell event where you can change Column's property (for example Font or anything else in Column), and then this properties will be used for drawing next cell.

If you want, you can use both versions in same IDE and slowly move to v6. They can be used together in same IDE.

Also I recommend visiting developer.bergsoft.net for reference and tutorials.

Best regards
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.

#7 BelangerC

BelangerC

    Senior Member

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

Posted 08 September 2017 - 09:37 PM

Hi, Boki:

 

I have gone through areas in my big project which uses NextGrid the most and have consolidated by questions regarding how to convert NextGrid5 to 6. Because users have been experiencing blacked-out grids with v5 I have been looking forward to v6 for some time now. There is no going back for me and I cannot see the value of slowly moving from v5 to v6, so I really need your help! Thank you!

 

First, can you confirm the column type mapping. I have an asterisk * next to those that I actually use. 

 

Column Types Mapping
*TNxTextColumn6= TNxTextColumn
*TNxButtonColumn6 = TNxButtonColumn
TNxIntegerColumn6
TNxFloatColumn6
*TNxNumberColumn6 = TNxNumberColumn
TNxIncrementColumn6 = TNxIncrementColumn
*TNxMemoColumn6 = TNxMemoColumn
*TNxGetDateValueEvent = TNxTimeColumn/TNxDateColumn not sure which
*TNxCheckBoxColumn6 = TNxCheckBoxColumn
*TNxComboBoxColumn6 = TNxComboBoxColumn
TNxListColumn6 = TNxListColumn
TNxCheckComboBoxColumn6
TNxToolbarColumn6
TNxSideEditNumberColumn6
*TNxProgressColumn6 = TNxProgressColumn
*TNxIconColumn6 = TNxImageColumn
TNxGraphicColumn6 = TNxGraphicColumn
TNxColorColumn6 = TNxColorColumn
TNxTrackbarColumn6
TNxHTMLColumn6 = TNxHtmlColumn
*TNxTreeColumn6 = TNxTreeColumn
TNxPropertyListColumn6
???????????????????? = TNxRateColumn
???????????????????? = TNxPopupColumn
???????????????????? = TNxStringsColumn
???????????????????? = TNxCalcColumn
???????????????????? = TNxHyperlinkColumn
 
This next batch of questions regards how I can get the same functionality from V6 vs V5:
 
TNxColumn
DefaultWidth <== I use this
HighlightButton
ShowLines (TreeColumn) <== I use this
DefaultWidth, CheckBox col
Options, Checkbox
DrawingOptions, Checkbox
DefaultWidth, Text col
Options, Text col

 

TNextGrid6:
 
Missing Properties/Events
 
AppearanceOptions
EnableVisualStyles
GridLinesColor <== I use this property
HeaderStyle
HighlightedTextColor
Options <== I use this
RowSize <== I use this
SelectMOveDirection
OnApplyEditText
OnCellColoring <== I use this
OnEditText <== I use this
OnSelectCell = OnSelect? 
OnCellFormating
OnExpand <== I use this
OnColumnResize
OnEdit
OnHeaderClick <== I use this
 
also. I use everything in this list
 
Missing:
TCellState: csSelected, etc
Grid.Columns.Exist
Grid.Cell[].Clear
Grid.GetRowAtPos
Grid.GetLevel
Grid.Columns[ACol].Options coEditing
Grid.HasChildren
Grid.Expanded
TNxComboBoxColumn6.InputValue
Grid.Columns[ACol].Display
Grid.Columns[ACol].Display.asBoolean
TNxToolButton.OnClick
Grid.SlideSelectionColor
Grid.OnCellHint
Grid.OnHeaderDblClick
Grid.GridSpace; TGridLinePosition
Grid.OnChange
Grid.OnCustomDrawHeader
Grid.InnerWidth
Grid.HeaderSize
TNxTreeColumn.Index
TNxNumberColumn.Index
AddChildRow(Grid.SelectedRow, crLast); crLast is undeclared
Grid.GetFirstChild
Grid.GetLastChild
Grid.GetNextSibling
Grid.SelectedColumn
Grid.FirstRow
Grid.Columns.ColumnType, no ctString, ctBoolean, ctDate
Grid.Columns.Editor
Grid.GetCellRect
Grid.GetCellTop
Grid.ScollToRow
Grid.SelectLastRow
Grid.RefreshRange
TNxCustomColumn(6) what to replace with?
Cell.FontStyle
Grid.RowVisible
 
Thank you for your help!
Best regards,
Chuck


#8 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 09 September 2017 - 11:45 AM

Hi,

Many of grid properties you need are now inside GridView for example GridLinesColor etc.

If you set them in design-time, you need just to click on NxReportGridView61 box and you can edit properties.

In run-time you can use created object by Delphi.

Some of the features from your list (I will add them more):

- InputValue is InsertValue
- TNxRateColumn : I can add it for upcoming release
- RowSize is RowHeight now
- Styles: You can find 2 properties in most of the controls i.e. Styles, StyleOptions.
- OnExpand: OnRowExpandedChange now
- You can now safely access Row property of Grid and get properties like Height. Before you needed to use RowVisible and similar.
- OnCellColoring: Now inside view as OnGetCellColor (you can find some other useful events there like OnGetGridColor).
- ShowLines: Now also exists with same name.
- Cell now include full Font property. Reference: http://developer.ber...=120&lang=en-us

Version 5 is quite old component and v6 was logical (but hard) step. Good thing is that I'm now able to add new features much easily (old code was quite hard to expand).
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.

#9 BelangerC

BelangerC

    Senior Member

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

Posted 28 September 2017 - 12:02 PM

Hi, Boki:


I am slowly working my way through about 50 forms which use NextGrid in my application. I'm thinking for your sake that I will limit my questions to specific needs rather than to give you everything that seems to be missing or renamed, etc when converting NextGrid 5 to 6.

 

So, my first question:

 

In NG5 I did this:

with MainForm.gridScanScope do
    begin
      for i := 0 to Columns.Count - 1 do
      begin
   
       GridCopy.Columns.AddColumns(TNxColumnClass(Columns[i].ClassType));
       
        GridCopy.Columns[i].Visible := Columns[i].Visible;
 
      end;
 
In NG6 the AddColumns apparently becomes Add, but which one of the overloaded functions/procedures would be best to use or are they the same?

 
 GridCopy.Columns.Add(TNxColumnClass(Columns[i].ClassType)); //I understand that this is a function which returns a TNxColumn6
        //or
        GridCopy.Columns.Add(Columns[i]);
 
Thank you! There will be more.
Chuck


#10 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 28 September 2017 - 10:39 PM

Hi,

You can use longer one (with 3 parameters) if you want that grid create column for you and you need to set Caption and ShortCaption.

Second one if you want to create column object by yourself, customize it (set properties) and place it into grid. For example if you have column into some kind of container and you want to place them into grid.

Basically first method at one point calls second one.
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.

#11 BelangerC

BelangerC

    Senior Member

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

Posted 29 September 2017 - 04:03 PM

GETLEVEL for TreeviewColumns?

 

Hi, Boki:

Here is some code I am using now that references the tree level as I am moving grid information to a stringlist and that in turn is used in a report output.

 

My question is how best to access GetLevel? I see you have GetLevel in a number of classes in V6, but I am not clear about the best way to get at this method.

 

Thank you!

 

 

with grid do

begin

 // now move the grid over to the string list
      for i := 0 to Grid.RowCount - 1 do
      begin
        if aStringList[i] = '1' then
        begin
         aGridRow := Cell[0, i].AsString;
          /// add level marks
          // GetLevel is 0 based
          aGridRow := StringOfChar('+', GetLevel(i)) + aGridRow + '|';
          // now add the cell values with '|' for each cell
 
          // skip the 0th column, just added that above
 
          for j := 1 to Columns.Count - 1 do
          begin
            // cell value will be null if nothing, i.e. '||'
            aGridRow := aGridRow + Cell[j, i].AsString + '|';
          end;
          GridTableRows.Add(aGridRow);
        end; // stringlist = 1
end; //grid


#12 BelangerC

BelangerC

    Senior Member

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

Posted 29 September 2017 - 04:21 PM

Hi, Boki:

 

With NextGrid 5 we had a number of tree navigation methods:

 

Grid.GetFirstChild
Grid.GetLastChild
Grid.GetNextSibling
 
How do I get the same information in NG6?
 
Thank you!


#13 BelangerC

BelangerC

    Senior Member

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

Posted 29 September 2017 - 04:26 PM

Hi, Boki:

 

Adding Child Row in a Tree column:

 

In NG5 we did:

AddChildRow(Grid.SelectedRow, crLast);

 

where in NG6 crLast is undeclared

 

Also, it looks like AddChildRow is now a function returning a INxRow. 

 

How do I convert my current AddChildRow to get the same functionality? i.e. I am adding a child row to the SelectedRow and I want to be added at the bottom of the current siblings rows that exist.

 

Thank you!



#14 BelangerC

BelangerC

    Senior Member

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

Posted 29 September 2017 - 04:49 PM

Grid.Options/AppearanceOptions in NG6:

 

Hi, Boki:

 

In NG5:

DFM:

AppearanceOptions = [aoAlphaBlendedSelection, aoBoldTextSelection, aoHighlightSlideCells, aoIndicateSelectedCell]

 

I understand that in general these settings are now in NextGridView, or should be?

I see that TNxAppearanceOptions = set of (aoHintIndicators, aoStyleColors); is declared in NxTypes6, but as you can see the NG5 AppearanceOptions are completely different.

 

How do I get the same AppearanceOptions of NG5 in NG6?

 

Likewise for 

 Options = [goGrid, goHeader, goIndicator]

or

Options = [goGrid, goHeader, goIndicator, goMultiSelect, goSelectFullRow]

 

I do not see anything similar in NG6. There does not seem to be anything like "Options"

How do I set these states in the grid in NG6?

 

Thank you!



#15 BelangerC

BelangerC

    Senior Member

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

Posted 30 September 2017 - 12:15 AM

Grid.Expanded replacement confirmation

 

Hi, Boki:

Just want to confirm:

 

NG5:

Grid.Expanded[LastAddedRow] := FALSE;
 
NG6:
Grid.ActiveView.ExpandRow(LastAddedRow, False);
 
The above expands or collapse the treed row, but how do I check the Expanded state? I need a boolean function that acts like the old NG5, Grid.Expanded[Row#]. 
I see that there is a Row.Expanded function but how do I get a Row (not sure of the class) from the row number?
 
 
Thank you
Chuck


#16 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 30 September 2017 - 11:36 AM

Grid.Expanded replacement confirmation
 
Hi, Boki:
Just want to confirm:
 
NG5:
Grid.Expanded[LastAddedRow] := FALSE;
 
NG6:
Grid.ActiveView.ExpandRow(LastAddedRow, False);
 
The above expands or collapse the treed row, but how do I check the Expanded state? I need a boolean function that acts like the old NG5, Grid.Expanded[Row#]. 
I see that there is a Row.Expanded function but how do I get a Row (not sure of the class) from the row number?
 
 
Thank you
Chuck


Hi,

(I will answer one by one question slowly)

You can simply use property:

NextGrid61.Row[xy].Expanded

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.

#17 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 30 September 2017 - 11:41 AM

Grid.Options/AppearanceOptions in NG6:
 
Hi, Boki:
 
In NG5:
DFM:
AppearanceOptions = [aoAlphaBlendedSelection, aoBoldTextSelection, aoHighlightSlideCells, aoIndicateSelectedCell]
 
I understand that in general these settings are now in NextGridView, or should be?
I see that TNxAppearanceOptions = set of (aoHintIndicators, aoStyleColors); is declared in NxTypes6, but as you can see the NG5 AppearanceOptions are completely different.
 
How do I get the same AppearanceOptions of NG5 in NG6?
 
Likewise for 
 Options = [goGrid, goHeader, goIndicator]
or
Options = [goGrid, goHeader, goIndicator, goMultiSelect, goSelectFullRow]
 
I do not see anything similar in NG6. There does not seem to be anything like "Options"
How do I set these states in the grid in NG6?
 
Thank you!


Hi,

After you add one (or few) views, you can simply click on view (NxReportGridView61 for example) and you will find these properties. Most of them are now simplified such as GridLines (Boolean), ShowHeader, ShowFooter etc.

You can also access view object from code like:

NxReportGridView61.GridLines := True;
I done this because Report and Slides view don't have same properties. For example SlidesView have height of slide etc.

In v5 I merged them into same place since I didn't plan SlidesView when I started with writing control.
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.

#18 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 30 September 2017 - 11:46 AM

Hi, Boki:
 
Adding Child Row in a Tree column:
 
In NG5 we did:
AddChildRow(Grid.SelectedRow, crLast);
 
where in NG6 crLast is undeclared
 
Also, it looks like AddChildRow is now a function returning a INxRow. 
 
How do I convert my current AddChildRow to get the same functionality? i.e. I am adding a child row to the SelectedRow and I want to be added at the bottom of the current siblings rows that exist.
 
Thank you!


You can again access to Row object:

  NextGrid61.Row[4].AddChildRow(3); // <-- 3 is count
or

NextGrid61.Row[4].AddSiblingRow(2); // <-- 2 is count
Inside INxRow interface you can find many other methods like:

NextSibling, PrevSibling etc.

To sum: You can now work with Row as normal object. Before I needed to have many methods like GetExpanded(x), GetSelected(x) etc, but now you can find them in Row[x].PropertyOrMethod
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.

#19 BelangerC

BelangerC

    Senior Member

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

Posted 01 October 2017 - 02:58 AM

Thank you, Boki, for all that! It is helping. 

There is one conversion that seems like it should be INxRow, but I cannot find:

NG5: Grid.GetFirstChild(x)

What is the equivalent in NG6?

 

Also, is NG5 Grid.FirstRow = to Row(0)? Or?

 

Another: What is the NG6 equivalent of NG5 Grid.SelectedColumn? Seems odd that it is undeclared since SelectedRow does exist.

 

Thank you!

Chuck



#20 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 01 October 2017 - 03:37 PM

Hi,

You can use:

NextGrid61.Row[4].ChildRow[0]...
But if you want I can add helper property FirstChild to the row. It will be easy.

If you need Integer, You can use SelectedCol property instead.

FirstRow: You can access NxReportGridView61.FirstIndex for this purpose.
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