Allow only one row checked

Hello
I open the example of Ado Selection..(DBAdvGrid Samples). and i insert such code in order
to have only one row checked. But it does not work. because the row remain checked.
...
procedure TForm1.DBAdvGrid1CheckBoxClick(Sender: TObject; ACol, ARow: Integer;
  State: Boolean);
var
  i: Integer;
begin
  for i := 1 to DBAdvGrid1.RowCount - 1 do
  begin
    DBAdvGrid1.SetCheckBoxState(ACol, i, TCheckBoxState.cbUnchecked);
    DBAdvGrid1.RepaintRow(i);
  end;
  DBAdvGrid1.RepaintRow(ARow);
end;
..
My Question is: how to have only one row checked?. I mean when I click i would like to unchecked the other row.. and have only one?
Thanks

I tested this with the code:


procedure TForm1.DBAdvGrid1CheckBoxClick(Sender: TObject; ACol,
  ARow: Integer; State: Boolean);
var
  i:integer;
begin
  DBAdvGrid1.RepaintRow(ARow);

  for i := 0 to dbadvgrid1.RowCount - 1 do
  begin
    if i <> ARow then
      dbadvgrid1.SetCheckBoxState(1,i,false);
    DBAdvGrid1.RepaintRow(i);
  end;
end;

and this works as expected.