Jump to content


Photo

Edit Events article for NextGrid6


  • Please log in to reply
4 replies to this topic

#1 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 04 April 2016 - 01:16 PM

Dear Users,

Here is a new article about NextGrid v6 edit events:
http://developer.ber...hp?topic_id=683

Diagram is a little big, but I hope it helps understanding these group of events better.
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.

#2 bicks

bicks
  • Members
  • 8 posts

Posted 13 May 2020 - 05:53 AM

Hello Boki,

 

I have a simple NextGrid with 3 columns and 3 rows. When I try to edit value or change color of a cell[0,0], while other cell[1,1] is in edit mode, the EditText of the cell[1,1] changes with the value of the cell[0,0].

Here is example of my code:

procedure TForm1.Button1Click(Sender: TObject);
begin
Nextgrid61.AddCells(['300','Mamma','vector'],[0,1,2]);
Nextgrid61.AddCells(['50','Papa','mode'],[0,1,2]);
Nextgrid61.AddCells(['2555','sota','tor'],[0,1,2]);
nextgrid61.EditCell(1,1);
end;

procedure TForm1.NextGrid61KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
if key=vk_F1 then nextgrid61.Cell[0,0].Font.color:=clRed;
end;

When I press F1 two actions happened: 

1. color of cell[0,0] changes to red.

2. Edit text of cell[1.1] become "300"

 

So, how to avoid the second action ?

 

Best Regards

Bicks



#3 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 15 May 2020 - 09:52 AM

Hello Bicks,

 

Very veird problem. I will try to debug it and fix it.

 

I hope that I will have fixed it for upcoming release.


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 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 15 May 2020 - 10:11 AM

Hi,

 

Try to change next line 254 in NxGrid6.pas:

 

   if Assigned(InplaceEdit) then
    begin
      if (Location = EditingCell) then InplaceEdit.AssignValue(Cell); // <---- updated line
    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.

#5 bicks

bicks
  • Members
  • 8 posts

Posted 17 May 2020 - 09:20 AM

Thank you, Boki.

 

It worked fine, now.

 

And the better thing is, that this code also solve few other issues that I had.

 

So great Thanks for you.  :)






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users