Solved

CanSelect on a DBGrid

Posted on 2001-07-25
1
268 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Strange behavior when a form is closed 6 57
How to debug For loops? 3 49
JAudiorecorder record freezing the app 29 67
can i put an image from resource into image tag ? 6 25
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…
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…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

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