Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Edit Records from DBGrid

Posted on 2002-07-10
3
Medium Priority
?
248 Views
Last Modified: 2010-04-04
Im just new in Delphi Programming so I hope somebody could help me with this. How do I link a DBEdit box and combobox to a DBGrid columns(which is connected to a database) so as when I click a record from the dbgrid I can edit or delete that record using the editbox, combobox and command buttons. I also need to add records by clicking an ADD button and the type the the data in the edit boxes and combo boxes. And also, I want to restrict the user to type anything in the DBGrid, I want all editing in the editboxes, how do I do this? Hope somebody could help me. Thanks.
0
Comment
Question by:sharol
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 450 total points
ID: 7145162
use the same datasource for the grid and your dbedits,
set the grid readonly (property)

you could use three buttons

edit-method=datasource1.dataset.edit;
new-method=datasource1.dataset.insert; //or append

//following is only available, if edited or new
save-method=datasource1.dataset.post;
maybe-cancel-method=datasource1.dataset.cancel;

you could also use a tdbnavigator for this
(just connect it to the same datasource)

hope this helps

meikl ;-)

0
 

Author Comment

by:sharol
ID: 7145287
is this also possible if the list/items of the combo box is coming from another table?
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7148641
yes,

you could use a tdbcombobox or a tdblookupcombobox

by the tdbcombobox you've to fill the entries at appstart

meikl ;-)
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question