Solved

CanSelect on a DBGrid

Posted on 2001-07-25
1
262 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
Comment Utility

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now