Howdy, Stranger!

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

In this Discussion

TElTreeInplaceDateTimePicker embedded in TElXTree: How to use the keyboard to enter Edit mode?

There are 2 columns of dates in the ElXtree; columns 0 and 1.
RoSelected and FullRowSelect are both True.

When the user presses F2 I want the left column of dates to be placed into edit mode,
and Shift+F2 for the right column of dates.

I use an Action Manager action to process the keys, and this is not an issue.

I have tried:

  with TimeTree do
  begin
    RowSelect     := False;
    FullRowSelect := False;

    with ItemFocused do
    begin
      Cells[0].Selected := True;
    end;
  end;

  InPlaceDTP.StartOperation();

Although there is a change of highlight on the row that is similar to what happens when I use the mouse to edit one of the datetime cells, I am unable to edit the datetime value.

What needs to be done to make this work?

Thanks.
Raymond

Comments

  • 3 Comments sorted by Votes Date Added
  • Found it by searching through all the possible functions of XTree in the Delphi editor.

    The following Action item has shortcut F2 and does exactly what I want.

    Sorry to bother you, but some more information in the Help would be helpful.

    Raymond

    procedure TMainForm.EditCellActionExecute(Sender: TObject);
    var
      ActiveColumn : Integer;
    begin
      ActiveColumn := GetActiveColumn(ItemTree);

      if not (ActiveColumn in [0, 4, 5]) then
      begin
        Exit;
      end;

      ItemTree.EditItem(ItemTree.ItemFocused, ActiveColumn);
    end;

  • Posts: 0 Accepted Answer Vote Up0Vote Down
    Thanks for feedback
Sign In or Register to comment.