Jump to content


Photo

Nextgrid selectedrow

selectedrow

  • Please log in to reply
No replies to this topic

#1 luc

luc
  • Members
  • 2 posts

Posted 03 October 2013 - 05:23 PM

Hello Boki,

I have the following code to walk in a Nextgrid, pressing the down arrow


if Key=40 then
begin
if Contactgrd.SelectedRow=contactgrd.Rowcount-1 then cr:=0 else cr:=1; // at end of grid cr =0 else cr=1
Contactgrd.selectedrow:=Contactgrd.SelectedRow+cr;
ContactgrdCellClick(Self,0,Contactgrd.SelectedRow);
Contactgrd.SelectCell(0,Contactgrd.SelectedRow,[]);
end;

This all goes well but suppose i have 3 rows in the grid and starting on row 0
when i use the arrow down key the Contactgrdcellclick procedure is executed and the selectedrow=1.
But when i look at my grid, the selection indicator is set to row 2, which is wrong because it should be set to row 1 , but the selectedrow remains = 1

Can you help me with this ?

MAny thx

Luc
Attached is a sample project....

Attached Files







Also tagged with one or more of these keywords: selectedrow

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users