Howdy, Stranger!

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

In this Discussion

TElTreeInplaceComboBox questions

Two questions, regarding TElXTree and editors:-

First, how can I have a combo where the user can only select from the valid "Items", (Like Style = csDropDownList)on a standard combobox?

 http://docwiki.embarcadero.com/Libraries/XE5/en/Vcl.StdCtrls.TComboBox.Style

Second, The number of clicks required to edit tree items seems excessive: A double-click to open the editor, another click to choose a new value, and then another click outside the chosen cell to "commit" the edit. How can I remove the last click so that choosing something from the dropdown automatically commits the edit?


Comments

  • 5 Comments sorted by Votes Date Added
  • edited October 2013 Posts: 0 Accepted Answer Vote Up1Vote Down
    Did you set the Style propety of the ComboBox control to csDropDownList (e.g. with (Sender as TElTreeInplaceComboBox).Editor.Style := csDropDownList;)? 
    If yes, please send an example project to mail@lmdteam.com to check out what you are actually doing (when zipped, rename file e.g. to myfile(dot)zip, otherwise file will be blocked). Mention IDE and ElPack release with your eMail.
  • Hi,

    >>First, how can I have a combo where the user can only select from the valid "Items", (Like Style 
    = csDropDownList)on a standard combobox?<<
    Actually this is the default. In BeforeOperation event specify the valid items. In AfterOperation event set accept or discard this element. The Sender property is the actual inplaceeditor control (check the sender.classname property to learn the type for typecasting).

    If you need different editors for different columns, you should use the InplaceEditorNeeded event instead (and here actually you provide yourself a suitable inplace editor).

    Regarding clicks:
    Enable quick edit mode with QuickEditMode property. 
    For the last quick: There is no other automatic way instead of exiting the current cell.
  • Thanks

    I do set up the items in BeforeOperation  but the user can still type something else and I have to validate the result. I don't want to allow the user to type into the editor. Like Style = csDropDownList
  • edited October 2013 Posts: 52Vote Up0Vote Down
    > Did you set the Style propety of the ComboBox control to csDropDownList (e.g. with (Sender as TElTreeInplaceComboBox).Editor.Style := csDropDownList;)? 

    No. The Editor property isn't published so I wasn't aware of it. Let me try...

    Yes, that works perfectly. Thanks!
Sign In or Register to comment.