Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

ElXTree: ElTreeInplaceCheckBox: Which values to use for True and False?

The ElXTree has a column with type set to Boolean in the HeaderSections property.

I placed the ElTreeInplaceCheckBox on the form and set the Tree to be my ItemTree.

I left the default value to be '*', because that's what was there when I dropped it on the form.

However, the values of Boolean are True/False or -1/0.

I don't see checkboxes in the column.

What value do I give ItemTree.Items.Item[i].Cells[1].Text so that the cell will display as a checked checkbox?
What value for an unchecked checkbox?

Thanks.

Raymond

Comments

  • 2 Comments sorted by Votes Date Added
  • >>I don't see checkboxes in the column.<<
    They are shown, when field is in edit mode.

    >>What value do I give ItemTree.Items.Item[i].Cells[1].Text so that the cell will display as a checked checkbox? What value for an unchecked checkbox?<<
    Maybe here is great misunderstanding. To show checkboxes you use cell controls. 
    A CheckBox inplace editor is used to allow enduser to select between (text) values - using either DefaultConversion (therefore DefaultValueAsText for checked items) or writing an own AfterOperation method for the editor. Example:

    procedure TfrmLMDElXTree_InplaceEdit.ElTreeInplaceCheckBox1AfterOperation(Sender: TObject; var Accepted, DefaultConversion: Boolean);
      if TElTreeInplaceCheckBox(Sender).Editor.Checked then
        TElTreeInplaceCheckBox(Sender).ValueAsText := 'I am checked'
      else
        TElTreeInplaceCheckBox(Sender).ValueAsText := 'I am not checked';
      DefaultConversion := false;
      Accepted := true;
    end;
Sign In or Register to comment.