Solved

CanSelect on a DBGrid

Posted on 2001-07-25
1
269 Views
Last Modified: 2010-04-06
Is it possible to a cell in a DBGrid, so the user can not access to it.
For example, the column Status can be changed by the user if the status is OK or DEL, but can not change it if it is something else.
0
Comment
Question by:frdep
1 Comment
 
LVL 2

Accepted Solution

by:
Drareg earned 50 total points
ID: 6319729

You can try this :


Procedure TForm1.DBGrid1CellClick(Column: TColumn);
Begin
  If Table1Status.Value In ['OK', 'DEL'] Then
    Begin
      // If you use a drop box.
      Column.ButtonStyle := cbsAuto ;
      Column.ReadOnly    := False ;
    End
  Else
    Begin
      Column.ButtonStyle := cbsNone ;
      Column.ReadOnly    := True ;
    End ;
End ;
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying 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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

839 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