Jump to content


Photo

NG5.OnHeaderClick, OnHeaderDblClick in NG6


  • Please log in to reply
1 reply to this topic

#1 BelangerC

BelangerC

    Senior Member

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

Posted 04 June 2023 - 11:12 AM

Hi, Boki:

 

I would like to apply the same event code to each column for my old code for NG6, OnHeaderClick:

 

// allow selection of column, mainly for deleting columns; otherwise dbl click
  // brings up column editor
  IF TV.EditTreeTable THEN
  BEGIN
    WITH GridView1 DO
    BEGIN
      SelectedColumn := ACol;
      GridHeaderClick := true;
      // change tbDeleteColumn hint if Hidden;
      if Pos('$T', string(Columns[ACol].Footer.Caption)) > 0 then
        tbDeleteCol.Hint := 'Restore Hidden Column'
      else
        tbDeleteCol.Hint := 'Delete/Hide Column';
    END
 
I am quessing that I could do this by referencing this code within the Grid.Column.OnHeaderClick or the GridView.OnHeaderMouseDown? I am thinking that the OnHeaderMouseDown would be best to handle all grid column headers the same way, yes?
 
Also, I do not see a OnHeaderDblClick. Is there some way to handle a dbl click via this event? I am thinking the TShiftState of ssDouble would be the best way to do this in the OnHeaderMouseDown event.
Can you please confirm?
 
Thank you,
Chuck
 


#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 04 June 2023 - 01:03 PM

Hello Chuck,

 

You are right, the event in GridView.OnHeaderMouseDown is a good candidate for your case.


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