Jump to content


Mountain

Member Since 28 Dec 2010
Offline Last Active Oct 17 2022 10:46 PM
-----

Topics I've Started

Something's wrong with ClearRows

04 August 2021 - 01:30 PM

Hi!

 

Hope you are having a lovely summer.

 

I have created a small demo application (attached) to illustrate what happens.

Here's a grid with 15 rows:

Attached File  Image1.jpg   18.23KB   2 downloads

 

Case 1) Pressing button "New" clears the content of the grid, but the cell remains focused and active after ClearRows.

Attached File  Image2.jpg   10.91KB   0 downloads

 

Case 2) Pressing button "Load" clears the grid and then loads a file. Just like before, the cell is still active and In addition if the loaded grid has fewer rows none of them can be focused.

Attached File  Image3.jpg   14.38KB   0 downloads

 

Writing this far I realise the problem only seems to happen while a cell is being edited, so I tried calling EndEditing() before ClearRows() and that helps. As a  previous workarund I did:

SelectedRow := -1;
SelectedCol := -1;
ClearRows;
 
Can you please add EndEditing() as the first line of ClearRows() in the official sourcecode? Or could that have other consequences? Perhaps you kow a better way to solve the problem? Maybe a new procedure EndEditingAndClearRows(). ;-)

CellHint only showing when column is enabled

07 August 2020 - 11:39 AM

Hi,

 

I have a grid with two columns. The first column has Enabled = False, and the second Enabled = True. The columns are like items and values in Registry or an ini-file. For some items I'd like to display a hint on what values are expected or valid.

The little red hint-indicator appears in the top right corner of the cells, but hints are not displayed.

 

I tracked it down to procedure TNxGridView6.SetHoverCell in unit NxGridView6.pas, specifically the following condition:

if IsSet(FHotCell)
  and Columns[FHotCell.X].Enabled then
 
Is there a reason why the column has to be enabled? In that case, shouldn't the hint-indicator be hidden too?
 
To make it work for me I have altered it to
if IsSet(FHotCell) then
//      and Columns[FHotCell.X].Enabled then

 

Maybe you'd like to change it in the official version? If not as I have then it could perhaps be done with a property named something like OnlyShowCellHintsForEnabledColumns?

 

Have a lovely day. :-)