Jump to content


Photo

Highlighted Cell Tracking question.


  • Please log in to reply
7 replies to this topic

#1 golfbrad

golfbrad
  • Members
  • 15 posts

Posted 29 September 2015 - 10:15 PM

I am using Delphi XE8 and latest version of NextGrid.

I have a grid that is read only and am using full row selection to indicate what row is current.  I want to be able to populate some standard edit fields based on which row is highlighted so I need to "track" the highlighted row at all times.

This works fine IF I use the mouse on the grid to Select a cell/row, it will always fire the OnSelectCell event and give me "ARow".

It even works if I use the up/down arrow keys .... UNTIL .... the highlighted row becomes the FIRST or LAST row showing on the screen.  At this point I can keep pressing the down arrow key and it does NOT fire the OnSelectCell event.  I can't seem to track the highlighted row when I hit Page UP/DOWN keys either.

I can get it to fire the OnVerticalScroll event, but this event does NOT pass the current highlighted row (ARow).

 

Can someone assist me in determining how to track the highlight bar regardless of mouse click, up/down arrows, pg up, pg down, Home/End, etc....???

 

I appreciate any help I can get.



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 30 September 2015 - 10:10 AM

Hi,

It look like ambug, I will try to fix it today.
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 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 30 September 2015 - 06:27 PM

Hi,

 

Unfortunately , I am not able to trigger bug. Can you maybe send me small demo project? 

 

This is code that I have used (quite simple, maybe you can extend it to show me where bug is):

 

 
 
procedure TForm1.FormCreate(Sender: TObject);
begin
  NextGrid1.AddRow(20);
end;
 
procedure TForm1.NextGrid1SelectCell(Sender: TObject; ACol, ARow: Integer);
begin
  Caption := IntToStr(ARow);
end;

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.

#4 golfbrad

golfbrad
  • Members
  • 15 posts

Posted 30 September 2015 - 06:34 PM

Can you try it in DB Next Grid.   I forgot to mention that is what I am using.



#5 golfbrad

golfbrad
  • Members
  • 15 posts

Posted 01 October 2015 - 05:52 PM

Here is a screen capture of my DB NGrid.  When the highlight bar is at the bottom of the screen (Todd Cleveland record) AND I use down arrow key it does not fire the OnSelectCell event.  I have put messages in the code and sure enough it bypasses this event.  It fires OnVerticalScroll as it scrolls to more records, but it stops firing the OnSelectCell.  Same with Home/End/PgDn/PgUp,  once top/bottom row is highlighted and I scroll I lose the OnSelectCell.

 

 

Attached Files



#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 01 October 2015 - 07:32 PM

Hi,

 

I will work on it. Mentioning NextDBGrid helped :)


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 golfbrad

golfbrad
  • Members
  • 15 posts

Posted 11 January 2016 - 04:50 PM

Any luck with this fix ?

 

Thanks.



#8 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 11 January 2016 - 05:32 PM

Hi,

 

Please sorry for huge delay. I remember being stuck with this bug since in non-buffered mode I simply call:

 

SendMessage(Handle, WM_VSCROLL, SB_LINEDOWN, 0);

 

Otherwise I call SelectCell. 

 

Try to change last lines of MoveSelectionDown method of TNextDBGrid to:

 

 { Record outside buffer? }
  if Succ(DataLink.ActiveRecord) > Pred(DataLink.BufferCount) then
  begin
    SendMessage(Handle, WM_VSCROLL, SB_LINEDOWN, 0);
  end;
 
  SelectCell(SelectedColumn, R, Shift);

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users