Jump to content


Photo

TNxListGridView6.GetFirstRowInPage


  • Please log in to reply
3 replies to this topic

#1 DelphiToday

DelphiToday
  • Members
  • 153 posts
  • Gender:Male

Posted 15 August 2024 - 07:27 AM

VirtualGridMode: when using Showing := (Index mod 2) = 0; PageUp is not working anymore.

See source below and now it works. If this source is a better solution can you implement it?

function TNxListGridView6.GetFirstRowInPage: Integer;

  function FindFirstRowInPage: Integer;
  begin
    Result := FFirstIndex;

    while Result < RowCount do
    begin
      if Showing[Result] then
      begin
        Break;
      end;
      Inc(Result);
    end;
  end;

begin
  if (VirtualMode) then Result := FindFirstRowInPage
    else Result := FFirstIndex;

//  Result := FFirstIndex;
  { TODO: Solve better FindFirstRowInPage for VirtualMode }
//  if VirtualMode then Result := FindFirstRowInPage else Result := FFirstIndex;
end;

And the old one is not good because it's not looking at the first row in Page.

You can remove i think? Or rewrite it. That's better i think because i use something like this to calculate de Row center of the Page.

It's never been used in your sources.

///<summary></summary>
///<returns>Index of first row in Page</returns>
///<author>Eduard</author>
function TNxGridView6.FindFirstRowInPage: Integer;
var
  Count: Integer;
begin
  { 8/28/16: Changed 0 to -1 }
  Result := -1;

  Count := 0;
  while Result < RowCount do
  begin
    Inc(Result);
    if Showing[Result] then
    begin
      Inc(Count);
      if Count > VertScrollBar.Position then Break;
    end;
  end;
end;

Kind regards,

Eduard. :)
 

 

 

 



#2 DelphiToday

DelphiToday
  • Members
  • 153 posts
  • Gender:Male

Posted 16 August 2024 - 02:07 PM

Here is a sample source so you can see what i mean.

Executable included so you can test it right away.

Try a few times PageDn and then try PageUp. Oeps :o

Build with your latest update.

 

Attached File  Project1PdPu.zip   1.32MB   0 downloads



#3 DelphiToday

DelphiToday
  • Members
  • 153 posts
  • Gender:Male

Posted 18 August 2024 - 01:57 PM

I saw another (text) error. Look at attachment.

 

Attached File  BOKI_2024-08-18_124756.png   2.15KB   0 downloads

 

The Header Right Justify with padding is not working anymore. Even de sort indicator is wrong. 

I myself put an older 'NxGridStylePaint6.pas' (23-11-2021) back and now it's working like before. Date is old so don't know the version.

(Padding is never worked i think, seems 2px default with the old one)

 

Hope you can fix all of the problems.

 

Regards,

Eduard.

 

 



#4 DelphiToday

DelphiToday
  • Members
  • 153 posts
  • Gender:Male

Posted 21 August 2024 - 12:41 PM

You think you can fix it?

Regards.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users