Link to home
Start Free TrialLog in
Avatar of error77
error77

asked on

Add and Edit records on DBGrid

Hi all,

Is it possible to Add and Edit records on the DBGrid itself?

If yes, how please?

Thanks

Avatar of Thommy
Thommy
Flag of Germany image

DGrid always displays data from a dataset (Tclientdataset, e. g. a table, a text file) which is connected through a datasource.

Adding and editing records always affects data of the underlying dataset...
Avatar of error77
error77

ASKER

So, can it be done or not?
Avatar of Mahdi78
If you mean add TEdit in DBGrid, so
Yes, you can
Avatar of error77

ASKER

Well, I'm using KDBGrid, which has all that:

http://www.tkweb.eu/en/delphicomp/kcontrols.html

but even if it was a normal dbgrid, how can I edit a cell manually?

I didn't use this component, but if KDBGrid is ReadOnly by default you could switch ReadOnly property to false
Avatar of error77

ASKER

I've check and it hasn't got a radonly property :o/
Hi There;

Yes you can,

Use UpdateSQL Component to update Your DBGrid Content.
But you have to write SQL Statments to do :
Delete
Insert
Modfiy

Your Application Must have :
1-DBGrid   ReadOnly  = False
2-Query Component
3-UpdateSQL Component

Best Regards
Abdel
Avatar of error77

ASKER

KDBGrid does not have a readonly property :o/ Also, I want to edit the cell manually not by code.

Is this not possible?
ASKER CERTIFIED SOLUTION
Avatar of Ephraim Wangoya
Ephraim Wangoya
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of error77

ASKER

Mixed both solutions and it worked. Thanks very much!