[SOLVED] DBGrid question lazarus / 16-Databases ---------------------------------------------------------------------- Kyjan · 2011-01-22 10:51 Hi, I tried to find the solution on the forum, but failed, so I need your help, again. I have a DBGrid, and I'm able to hide some columns, but I want to disable some of the visible colums, too. So, I want that the user will be able to edit the content of only one column, but the DBGrid.Columns.Enabled:=False do not work. Any idea is welcome TIA Kyjan ---------------------------------------------------------------------- tintinux · 2011-01-24 16:05 Hi You can use the OnSelectEditor event and assign nil when you don't want user's input. Example : Code: [Select]procedure TForm1.GridSelectEditor(Sender: TObject; aCol, aRow: integer; var Editor: TWinControl); begin   if RowReadOnly(aRow) then     Editor := nil end;  Hope this helps. Regards, Tintinux ---------------------------------------------------------------------- Kyjan · 2011-01-27 14:28 Thx, Tintinux, i try to understand your code and implement it Regards, Kyjan ---------------------------------------------------------------------- Kyjan · 2011-01-27 15:27 The solution was so simple that it is my shame not to think of it: Code: [Select]Dbgrid1.Columns[1].Readonly:=True; This will disable the editing of the 1st column. Thanks, Tintinux, for the idea. Regards, Kyjan ---------------------------------------------------------------------- tintinux · 2011-01-27 16:29 Yes, I have forgotten this simple feature. It disable the entire column, and that's what you searched for. But to disable a row or a cell, my method is useful. Regards