andyhill Posted July 18, 2023 Share Posted July 18, 2023 I need to display a column as checkbox in code, please show how - Thanks with MyGrid do begin //Columns.Items[i].CheckBoxField:= True; //Columns.Items[i].CheckBoxField:= chkConfirmedEditor; //Columns.Items[i].Editor:= chkConfirmedEditor; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 19, 2023 Share Posted July 19, 2023 ? Quote Link to comment Share on other sites More sharing options...
andyhill Posted July 19, 2023 Author Share Posted July 19, 2023 Thanks but not working, what am I missing (grid columns built at runtime) ? Columns.Items[i].CheckBoxField.BooleanFieldOnly:= True; Columns.Items[i].CheckBoxField.FieldValues:= 'true,false'; Columns.Items[i].CheckBoxField.DisplayValues:= '+;-'; Columns.Items[i].CheckBoxField.Enabled:= True; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 19, 2023 Share Posted July 19, 2023 3 hours ago, andyhill said: Thanks but not working, what am I missing (grid columns built at runtime) ? Could you make a simple testcase to check? Quote Link to comment Share on other sites More sharing options...
andyhill Posted July 19, 2023 Author Share Posted July 19, 2023 It is hard because the project is complex, looking on forum others are having same problems with TUnimDBListGrid. The Field 'Accepted' is boolean, grid shows 'true' or 'false'. with ListGrid do begin Columns.BeginUpdate; Columns.Clear; ////////////////////////////////////////////////////////////////////////// i:= 0; Columns.Add; Columns.Items[i].FieldName:= 'Accepted'; Columns.Items[i].Visible:= True; Columns.Items[i].CheckBoxField.BooleanFieldOnly:= True; Columns.Items[i].CheckBoxField.FieldValues:= 'true,false'; Columns.Items[i].CheckBoxField.DisplayValues:= '+;-'; Columns.Items[i].CheckBoxField.Enabled:= True; Columns.Items[i].Alignment:= taCenter; Columns.Items[i].Title.Alignment:= taCenter; Columns.Items[i].Title.Caption:= 'OK'; //Columns.Items[i].Flex:= 1; Columns.Items[i].Width:= 30; Columns.Items[i].Font.Color:= clBlack; Columns.Items[i].Sortable:= False; Columns.Items[i].ShowSummary:= False; ////////////////////////////////////////////////////////////////////////// Columns.EndUpdate; end; Andy Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.