Jump to content


Photo

Can't reach grid end using down arrow


  • Please log in to reply
23 replies to this topic

#1 czbird

czbird
  • Members
  • 58 posts

Posted 04 September 2011 - 11:48 AM

Hello Boki,
I'm experiencing strange behaviour of NextGrid (version 5.4.1) related to the Down Arrow key.
It just does not let me reach the latest visible row. Please check the attached sample project.

Thanks & Regards,
Jan

Attached Files



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 05 September 2011 - 08:11 PM

Hi,

I will test it now.

Thank you.
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 06 September 2011 - 01:12 AM

Hi Jan,

Inside AddChildRow procedure from NextGrid.pas add:



  if FCells.Row[Index].Shown and (Pos > FLastVisibleRow)
    then FLastVisibleRow := Pos;

I hope that now works.
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 czbird

czbird
  • Members
  • 58 posts

Posted 06 September 2011 - 02:57 PM

Hi Boki,
Thank you for your suggestion.
I have added the code to the below place in NxGrid.pas.
It seems to have helped. Please confirm that this is the correct location.

procedure TNextGrid.AddChildRow(const Index: Integer;
  Position: TChildRowPosition);
var
  Pos, j: Integer;
begin
  case Position of
    crFirst: Pos := Index + 1;
    else Pos := Index + FCells.GetChildCount(Index) + 1;
  end;
  FCells.AddChildRow(Index, Pos);

  if goUseDefaultValues in Options then { using default values may slow down adding rows }
  begin
    for J := 0 to Columns.Count - 1 do
      if Columns[J].DefaultValue <> '' then Cells[J, Pos] := Columns[J].DefaultValue;
  end;

  if FCells.Row[Index].Shown and (Pos > FLastVisibleRow) { fix down arrow issue }
    then FLastVisibleRow := Pos;

  if not IsUpdating then
  begin
    if FCells.Row[Index].Expanded then
      ShowRow(Pos, RowSize, True);

    if FCells.Row[Index].ChildCount = 1 then
      RefreshRow(Index);
  end;

  FLastAddedRow := Pos;
  UpdateVertScrollBar;
end;


#5 czbird

czbird
  • Members
  • 58 posts

Posted 06 September 2011 - 03:12 PM

Hi Boki,
the END and PAGE DOWN keys now move focus beyond the last visible row.
Please check with the same sample project.

Thanks,
Jan

#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 06 September 2011 - 04:07 PM

Hi Jan,

Please try with next code:


procedure TNextGrid.AddChildRow(const Index: Integer;
  Position: TChildRowPosition);
var
  Pos, j: Integer;
begin
  case Position of
    crFirst: Pos := Index + 1;
    else Pos := Index + FCells.GetChildCount(Index) + 1;
  end;
  FCells.AddChildRow(Index, Pos);

  if goUseDefaultValues in Options then { using default values may slow down adding rows }
  begin
    for J := 0 to Columns.Count - 1 do
      if Columns[J].DefaultValue <> '' then Cells[J, Pos] := Columns[J].DefaultValue;
  end;

  if not IsUpdating then
  begin
    if FCells.Row[Index].Expanded then
      ShowRow(Pos, RowSize, True);

    if FCells.Row[Index].ChildCount = 1 then
      RefreshRow(Index);
  end;

  { Update FLastVisibleRow }
  if FCells.Row[Index].Shown and (Pos > FLastVisibleRow)
    then FLastVisibleRow := Pos;

  FLastAddedRow := Pos;

  UpdateVertScrollBar;
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.

#7 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 07 September 2011 - 12:28 AM

Hi,

Please try to modify next line:


  { Update FLastVisibleRow }
  if FCells.Row[Pos].Shown and (Pos > FLastVisibleRow) // <------- modified
    then FLastVisibleRow := Pos;

Please tell me how it works now.
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.

#8 czbird

czbird
  • Members
  • 58 posts

Posted 07 September 2011 - 12:26 PM

Thanks, Boki.
The sample project is now working fine.
I still have some issues in the main project, so I'll update the sample project and post it again.

#9 czbird

czbird
  • Members
  • 58 posts

Posted 07 September 2011 - 07:13 PM

Hi Boki, please check attached sample project 2.
Now, the grid is filled a little bit differently - in two separate cycles:
1) parents + level 1 children
2) level 2 children

Again, down arrow will not let you reach the last visible row.

Thanks,
Jan

Attached Files



#10 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 08 September 2011 - 10:29 PM

Hi,

I think that I have solved it. Can you please contact me via e-mail to I send you updated files.

One notice: Please use NextGrid1.Expanded[x] := True/False; instead of NextGrid1.Row[x].Expanded := True/False;

Best regards
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.

#11 czbird

czbird
  • Members
  • 58 posts

Posted 08 September 2011 - 11:56 PM

Hi Boki,
thanks for the news. I've sent you an email and am awaiting the updated files.

Regarding your note: In the sample project 2, if I change
Grid.Row[i].Expanded := false;
with
Grid.Expanded[i] := false;
, then all level 2 children remain visible.

Anyway, I'll check it again with the updated files.

Regards,
Jan

#12 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 09 September 2011 - 12:20 AM

Hi Jan,

I have solve this problem too :)

I have contacted you via e-mail.

Best regards
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.

#13 czbird

czbird
  • Members
  • 58 posts

Posted 09 September 2011 - 01:26 AM

Hi Boki,
Things are getting better and better :)
The Down Arrow now seems to be working correctly.

Have you also tried Page Down key? It scrolls beyond the last row (see picture).

Attached Files



#14 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 09 September 2011 - 02:01 AM

Hi Jan,

I will check it now. Please sorry for this problems.

Best regards
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.

#15 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 09 September 2011 - 11:41 PM

Hi,

I think that now is fixed :) I will do some testings and then send you on same e-mail address you have provide to me.

Best regards
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.

#16 czbird

czbird
  • Members
  • 58 posts

Posted 10 September 2011 - 11:53 AM

Hi Boki, sorry to inform you that the latest version behaves the same as the previous.
Down Arrow is OK, but Page Down takes you beyond last row.
In the Sample Project 2, just push Page Down three times after the grid is filled.

Regards,
Jan

EDIT:
By latest version, I mean this code in AddChildRow:
if Row[Pos].Shown then
  begin
    { Update FLastVisibleRow }
    if Pos > FLastVisibleRow
      then FLastVisibleRow := Pos;
  end else Inc(FLastVisibleRow);


#17 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 10 September 2011 - 03:40 PM

Hi Jan,

I have tested it with your demo and seems to work fine. I will send you files once again. Maybe when I zip files I didn't save them previously.

Best regards
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.

#18 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 10 September 2011 - 11:27 PM

Hi Jan,

Now I spotted it. I am working on it.
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.

#19 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 11 September 2011 - 12:06 AM

Hi Jan,

I have fixed it, completely :) I will send you files tomorrow. Thank you for your patience.

Best regards
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.

#20 czbird

czbird
  • Members
  • 58 posts

Posted 11 September 2011 - 01:08 AM

Thanks for the update.
I will check it and get back to you with the result.
Regards,
Jan




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users