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
  • 4 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
  • 7,879 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
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.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
  • 4 posts

Posted 18 April 2020 - 10:12 PM

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

 

Great support. Thanks again.







Also tagged with one or more of these keywords: nextgrid6, editcell

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users