Jump to content


Photo

Tnextgrid6.EditCell gives inaccurate result

nextgrid6 editcell

  • Please log in to reply
2 replies to this topic

#1 bicks

bicks
  • Members
  • 8 posts

Posted 18 April 2020 - 02:07 PM

Hello Guys,

 

I have the following simple problem: I need when edit one cell in TNextgrid6 and after press enter, program automatically to select another cell to edit.

So I'm writing the following code:

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
ogrid.Editing:=True;
gName.Editing:=true;
gVal.Editing:=true;
activecontrol:=ogrid;
ogrid.AddRow(5);
ogrid.EditCell(gName.Index,4);
end;


procedure TForm1.ogridKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
 if key=vk_return then
       ogrid.editcell(1,0);
end;
Unforunatelly, after the pressing Enter the program select cell on the Second row, although in code I ask for the cell in first row. 
I have tested to set different row, but program always select the cell bellow the desired. if cellRow is -1 - program gets error(cell doesn't exists)
 
Could you prease tell me what I did wrong.
Thank you 
Bicks

 



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 18 April 2020 - 02:53 PM

Hello Bicks,

 

Maybe this problem is happening for you because there is already support for selecting next cell. You can check SelectionDirection property and also WantReturn property.

 

Maybe you can also check AutoEditing property that can be found inside the column.

 

Hope that this helps.


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 bicks

bicks
  • Members
  • 8 posts

Posted 18 April 2020 - 10:12 PM

Thank you very much. SelectionDirection is enough to work properly. 

 

Great support. Thanks again.







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users