Topic: Editable Grid - make selected columns read only

Hello Dmitry,
I am using an editable grid with 3 columns (please see attached).
However, I want Column 0 to be read-only, Column 1 to be editable and Column 2 to be editable.
I have tried various options but have been unsuccessful so far.
Can you think of any way to do this?
Thanks,
Derek.

Post's attachments

Attachment icon editablegrid.zip 335.38 kb, 301 downloads since 2019-08-30 

Re: Editable Grid - make selected columns read only

Derek,
Try this.

procedure Form1_TableGrid1_OnChange (Sender: string);
begin
  Form1.Tablegrid1.columns[0].enabled := false;
end;
Post's attachments

Attachment icon editablegrid Revised.zip 335.76 kb, 329 downloads since 2019-08-30 

Re: Editable Grid - make selected columns read only

Hi EHW,
Well, don't I feel a fool - LOL!
I could swear I'd tried that first of all with no success before going on to try various cell enabling combinations (none of which worked).  I'll put it down to a 'senior moment'.......
Thanks for the help.
Derek.

Re: Editable Grid - make selected columns read only

LOL. It happens.

Re: Editable Grid - make selected columns read only

procedure Form1_TableGrid1_OnChange (Sender: TObject);
begin
    Form1.TableGrid1.Columns[0].Options := Form1.TableGrid1.Columns[0].Options - coEditing;
end;
Dmitry.

Re: Editable Grid - make selected columns read only

Привет Dmitry,,
Это работает именно так, как мне нужно сейчас.
Спасибо,
Derek.