Jump to content


BelangerC

Member Since 18 May 2005
Offline Last Active Dec 05 2023 06:10 PM
-----

Topics I've Started

Columns.Insert not actually inserting column, but adding to last position

25 September 2023 - 10:43 AM

Hi, Boki:

 

Tried:

 

WITH GridView2 DO
    BEGIN
 NxTableGraph6 :=  TNxIconColumn6.Create(GridView2);
     //this was not inserting new column; putting as last column
     Columns.Insert(1,NxTableGraph6);
....
end;
 
No INSERT, column added at last position.
 
Am I missing something?
 
Thank you,
Chuck Belanger

OnCellClick treats CheckBox click completely opposite in NG5 NG6

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

NxTextColumn: Random, Intermittent Font.Color changes?

27 August 2023 - 04:22 PM

Hi, Boki:

 

This is a weird one!

 

I have a unit which creates grids using stored grid properties in a database. I have been converting code, properties and events from NextGrid 5 to NG6.  I am using essentially the same code as NG5 and only making changes where the properties and events change in name or functionality. I have kept all the NG5 code and simply use a new NG6 grid which I can switch between NG6 and NG5 by a menu selection then having the user reload the grid in the alternate NextGrid 5 or 6. I will keep this fail safe menu item until convinced that the NG6 grids are equally functional as the NG5 grids. Right now, the NG5 grids do not display this behavior.

 

What I am seeing is that on bringing up any grid during run time, the text font of the various columns will change from the default, clBlack, to almost any color. All text in the grid will be assigned the same non-black color. On closing the grid and reopening/recreating it, the font.color may or may not be the same, often it will go back to the default color, clBlack, but on another attempt to reopen the grid the color may change again.

 

If I continue to open various grids, a new color may be assigned or the default black color may be used. No apparent pattern.

 

As the grid is created I have a procedure, SetColProps6, which assigns the font.color based on what is stored in the database. I tried setting the font.color explicitly to clBlack with no change to this random color assignment.

 

I am using the newer (compared to NG5) event: NxTextColumn6StyleText. But if I simply exit out of this event without running the code, still I am getting the random color assignment.

 

Where this becomes a problem is when the color is something like clYellow which is very difficult to read. Thankfully, I have not seen it become clWhite yet.

 

At this point I am completely at a loss as to where this happening. Can you either suggest where this might be happening or if you can or have observed this, suggest a fix?

 

Thank you,

Chuck

 


No Vertical Scrollbar for Treed rows in grid

23 August 2023 - 09:58 PM

Hi, Boki:

 

This is a real problem for me.

 

In my program I often add a row or rows to a grid, then later in code add all Child rows to any parent row which has such in a recursive routine.

 

I notice that in NG5 this adding of child rows after adding rows will properly show a vertical scroll bar when needed based on grid size and number of rows.

But, in NG6 this is not the case. No vertical scroll bar appears which means users cannot access the expanded rows that fall below the bottom of the grid.

BIG PROBLEM.

 

Now, in a simple test project, I noticed that if the treed rows and children are added as part of creating the grid and adding rows and child rows at the same time, all is well--the vertical scroll bar shows up.

 

But consistently, if I add rows then later in code add children to some or all of those rows then no vertical scroll bar becomes available when required to show the expanded grid.

 

Is this a bug or is there a way around this?

 

Later....

Ok, with experimenting, I found that if I issue Row[Index].Collapse(true) after each AddChildRow that that will allow the Vertical Scroll bar to appear. This works even if right after adding the row's children I expand all.

 

Still seems like a bug to me.

 

Thank you,

Chuck


NG5 to NG6 Conversion: NG6 equivalent to TColumnType/Kind?

23 August 2023 - 08:41 PM

Hi, Boki:

Trying to wrap up the NG5 to NG6 conversion but am still finding a number of differences which may kill the conversion process for me.

 

I will be asking about each as a separate topic as they come up in debugging of my program.

 

 

In NG5 you have the Grid5.Columns[ACol].ColumnType with possible property values of:

 TColumnType = (ctAutoInc, ctBoolean, ctNone, ctDate,
    ctFloat, ctGraphic, ctGuid, ctInteger, ctString, ctLookup, ctMemo, ctVirtual);
  TColumnKind = (ckTextual, ckBlob, ckNumeric, ckImage, ckComboBox,
    ckCheckBox, ckDate, ckProgress, ckRate, ckIncrement, ckHtml);
 
Do you have anything comparable to either ColumnType or ColumnKind in NG6? How do I get that information when processing events that are generic to different types of columns and their cells?
I am particularly interested in ColumnType although I could use the ColumnKind property as well.
 
Thank you,
 
Chuck