Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cell in DbGrid 1

Status
Not open for further replies.

juna23

Technical User
Jan 25, 2007
8
AL
I need to select only one cell in a DbGrid.
I don't think there is a property.

Can anyone help?

Thanks
Juna
 
Use a string grid.
The row and col properties are set to indicate a selected cell, (This may also be true for dbgids I haven't checked!)


Steve [The sane]: Delphi a feersum engin indeed.
 
I want to select it with code. something like grid.cells[].


Juna
 
Simply set the values of Row and Col.
The canselect must be true.

data.Row := 2;
data.Col := 2;

Its also possible to use the selection property and a Tgridrect, this example form the help files selectets multiple cells but you can use it to get just a single cell.

procedure TForm1.Button1Click(Sender: TObject);
var
myRect: TGridRect;
begin
myRect.Left := 3;
myRect.Top := 1;
myRect.Right := 2;
myRect.Bottom := 4;
DrawGrid1.Selection := myRect;
end;

Steve [The sane]: Delphi a feersum engin indeed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top