Jump to content


Photo

How [un]check a whole NxCheckboxColumn?


  • Please log in to reply
2 replies to this topic

#1 qi130

qi130
  • Members
  • 26 posts

Posted 30 November 2024 - 03:05 PM

Hello,

 

What's the best way to do this?

- loop ?

- delete column & recreate it

- hidden procedure I have not seen

 

Regards



#2 qi130

qi130
  • Members
  • 26 posts

Posted 30 November 2024 - 07:55 PM

Hello Boki,

 

In fact, I try to deal with delete a recreate the column.

 

But I experience malfunction as, using this code:

gridWagonSet.Columns.Delete(0);
gridWagonSet.Columns.Insert(TNxCheckBoxColumn,0);
with gridWagonSet.Columns[0] do begin
     Alignment:=taCenter;
     Width:=25;
end;

the column is in 2nd position in the grid :blink: and I need to add "Position:=0;"  in the with statement

 

Looking at the TNxColumns.InsertColumn procedure, : (called from TNxColumns.Insert function)

FItemsList.Insert(Pos, Column);
FPositionItemsList.Add(Column);

Shouldn't you insert (not Add) into the 2nd TList ?
 

 



#3 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 01 December 2024 - 02:49 PM

Hi,

 

I think the best solution is just to loop trough all cells in the column and set values to false. Deleting and inserting column again is probably slower.


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