How to get RecNo when clicking on a DBGrid?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get RecNo when clicking on a DBGrid?

larshgf
Hello,

 

I am using Delphi and FireDAC.

I have som editfields in the upper region of a tabsheet and a DBGrid in the
lower part. When I click on my DBGrid I would like to write the fields from
the choosen Record to the editfields.

I wonder if it is possible to get the RecNo of a record when clicking on a
DBGrid in my program.??

 

An alternative solution could be putting the selected records in a
stringgrid. I have a lot of trouble with these DataControls.!?!

 

Best Regards

Lars

 

 

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: How to get RecNo when clicking on a DBGrid?

Radovan Antloga
DbGrid is linked with DataSource and DataSource
with DataSet. DataSet can be TFDQuery or TFDTable.

You can read TFDTable.RecNo onclick event of DbGrid.
Why do you need that?

You do not have to write fields. Just put dbedit controls
on your form and link them with DataSource. On record
change they will be automaticaly populated with data.

Ragards Radovan

Lars Frederiksen je 29.09.2018 ob 17:33 napisal:

> Hello,
>
>  
>
> I am using Delphi and FireDAC.
>
> I have som editfields in the upper region of a tabsheet and a DBGrid in the
> lower part. When I click on my DBGrid I would like to write the fields from
> the choosen Record to the editfields.
>
> I wonder if it is possible to get the RecNo of a record when clicking on a
> DBGrid in my program.??
>
>  
>
> An alternative solution could be putting the selected records in a
> stringgrid. I have a lot of trouble with these DataControls.!?!
>
>  
>
> Best Regards
>
> Lars
>
>  
>
>  
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users