Jump to content

Mobile TUnimDBListGrid Column As Checkbox - How ?


andyhill

Recommended Posts

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;

Link to comment
Share on other sites

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;
 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...