Im trying to get value from specific cell from my TGrid but without success. I have try something like this
//Here i get value with a success but i need to get value from first column and
no matter what row it is clicked
TForm1.Grid1GetValue(Sender: TObject; const ACol,ARow: Integer; var Value: TValue);
begin
if grid1.Selected <> -1 then
x:= Value.ToString
end;
For example i clicked on third row.. i need value from first column third row cell. How can i do that?
If you read the documentation for the
OnGetValueevent, it says:This is when you are using the grid in a virtual-type mode, storing your data outside of the grid (in an array, a database, etc).
TGridby itself does not store any data. You would use the providedAColandARowvalues to access your own data storage as needed.If you want to store data in the grid itself, use a
TStringGridinstead, which has aCellsproperty for storing strings.