In DBGrid,I wanto Create a Column whithout dataset's field,How? lazarus / 16-Databases ---------------------------------------------------------------------- qiaoqia6448 · 2011-04-10 13:44 I wanto select some bills list from  a DBGrid,so ,wan to create a colunm as checkbox to record user's selection. var   c:TGridColumn; begin     C:=G.Columns.Add;      c.ButtonStyle:=cbsCheckboxColumn;     C.Expanded:=true;     C.ReadOnly:=false;         It can create the column ,But It Can't to edit,can't click !   Help!!!!! ---------------------------------------------------------------------- nicke85 · 2011-06-09 16:19 Have the same problem with stringgrid.. ---------------------------------------------------------------------- jesusr · 2011-06-11 16:24 @qiaoqia6448: Is explained here: http://wiki.lazarus.freepascal.org/Gr ids_Reference_Page#Selecting_Records_in_a_DBGrid_using_checkboxes @nicke85: a stringgrid should not have problem with this if grid.Options includes goEditing option. ---------------------------------------------------------------------- exdatis · 2011-06-11 18:55 For DBGrid, try calc field!? ---------------------------------------------------------------------- ribarvlada · 2011-07-27 11:47 Where I can find calc field in DBGrid? ---------------------------------------------------------------------- Zoran · 2011-07-27 13:27 Quote from: ribarvlada on July 27, 2011, 01:47:31 pmWhere I can find calc field in DBGrid? You cannot find it in grid, but you can define it in dataset – as a special kind of persistant field objects you can create calculated fields. Let's go step by step. First, create persistant fields objects for fields that actually exist in underlying database – right-click on your dataset (query) component, in pop-up menu, click "Edit fields" – the dialog opens – then right-click somewhere in this dialog and click "add fields" (note that you need to have active connection in design time for this, but you can disable it after you finish it). Add all fields you need and now you have persistent fields. Now, add calculated fields – do same as in previous step to open "Edit fields" dialog, right-click inside the dialog, but now instead of "add fields" chose "new". In new dialog, chose "calculated" radio button, give the new field the proper name and chose its type. Now, the dataset has OnCalcFields event, use it, something like this: Code: [Select]MyFirstCalculatedField.AsInteger := ....; MySecondCalculatedField.AsString := ...;I almost forgot – if I remember correctly, you also need to set DataSet's AutoCalcFields to true, but I am not sure, please try it yourself. Now, to DBGrid. Right click on the DBGrid and click "Edit columns", then "add column". When the column is created, you can find it in Object inspector and find its field property. Chose the field you want. Create a column for every field you created and adjust it properly. Try to play with it and discover more yourself...