Recent

Author Topic: DBGrid READONLY column selection  (Read 1583 times)

iru

  • Sr. Member
  • ****
  • Posts: 321
DBGrid READONLY column selection
« on: March 04, 2015, 11:27:40 pm »
Gentlefolk,

This is more philosophical than technical and I am looking for ideas on what I should do in the following situation:

A DBGrid with most of the columns set to READONLY to display information and two columns where data can be input.

If the user clicks on a cell in a READONLY column this cell is highlighted giving the user the idea that the cell is accessible.

What should I do?

In the "OnClick" code simply set the colour of the cell to the background colour therefore ignoring the 'click'.

In the "OnClick" code display a error message to the user.

In the "OnClick" code set the  "SelectedIndex" to a 'Readable" column in the same row.

Something else?

Any help appreciated, Ian.

 

mm7

  • Full Member
  • ***
  • Posts: 193
  • PDP-11 RSX Pascal, Turbo Pascal, Delphi, Lazarus
Re: DBGrid READONLY column selection
« Reply #1 on: March 10, 2015, 09:38:42 pm »
There is OnDrawCell event in TStringGrid, in a handler of that you can paint whatever you like. In DBGrid there is OnDrawColumnCell. Try that.

 

TinyPortal © 2005-2018