Solved

CanSelect on a DBGrid

Posted on 2001-07-25
1
270 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
[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
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

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 Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…

740 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