Solved

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

Posted on 2006-07-21
3
182 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 125 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

728 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