?
Solved

is there anyway to set a specific field of a dataset editable

Posted on 2006-07-21
3
Medium Priority
?
183 Views
Last Modified: 2010-04-05
I'm using
   DataSource1.DataSet.Edit;
to set my fields to editable.

A situation has come up where I would like to set a specific field in my table to editable and none of the other ones is this possible and how do I do it?  

So something like
DataSource1.DataField('Fieldname').Edit
0
Comment
Question by:ICPooreman
[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
3 Comments
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 17157040
you can set "ReadOnly" to true on each field
so in your case, you could set them all to false except the one you want to edit
0
 
LVL 4

Accepted Solution

by:
JDSkinner earned 500 total points
ID: 17158041
Hi
Try
procedure TForm1.FormCreate(Sender: TObject);
var iCounter: integer;
    iEditColumn: integer;
begin
    iEditColumn:= 3; // any column to be edited
    for iCounter := 0 to (DBGrid1.Columns.Count-1) do
    begin
        if iCounter <> iEditColumn then DBGrid1.Columns[iCounter].ReadOnly:= true;
    end;
end;
0
 
LVL 9

Expert Comment

by:sun4sunday
ID: 17160831
or you can do it with enable and disable to component like DBEdit. Once it disable, the user cannot edit on that field.
Make disable/Enable depends on the criteria you need.

sun4sunday
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month12 days, 20 hours left to enroll

777 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