I have a TreeView control which uses multiple different types of embedded editors at each node. I'm having a problem with one editor in particular which has EditorButtons on it. There is code that changes the Visible and/or Enabled state of the EditorButtons, but although this code works fine for this control when it is not in the TreeView (just on a normal WinForm object), it doesn't want to refresh the visible status of the control when within the TreeView. I'm sure this has something to do with the nature of how embedded editors are handled, but I've tried everything I can think of from a direct Invalidate and Refresh call on both the embedded control and TreeView parent to my own DrawFilter. Certainly there is some event or method that I'm missing that is failing to force the embedded control from reflecting the current properties of the Editor Buttons? Thanks
Hi Mike. The TreeView is setup in OutlookExpress style so I'm using columns and cells. The control is set using EditorComponent. Each node has it's own editor. In some cases the same type of editor may be used in multiple nodes, but this particular control is only used in a single node.
I don't want to muddy this post with additional questions, but the reason that I'm doing this is directly related to my needs so I will add a few more details. I was trying to use a DropDownEditorButton initially but didn't want the dropdown button to appear - only the image. I had managed to do this using a DrawFilter. This worked outside of the Tree, but not when it was embedded in the Tree. And when I tried using a DrawFilter on the Tree it was able to update the look of the button but created problems with other EditorButtons on other nodes. And I still had the problem with the visible/enable not working (as above). That's when I figured I was making this more complicated than it had to be and tried to find another approach (expecting that DrawFilters on embedded controls was just getting unnecessarily complicated for what I was trying to achieve). Then I came across this post:
http://ko.infragistics.com/community/forums/t/55171.aspx
A brilliant, yet simple work-around of using an EditorButton that then calls the DropDown of an invisible DropDownEditorButton. This works on its own, but doesn't as soon as I use it embedded in the Tree - error is "the associated editor must be in edit mode to be dropped down". I'm calling the DropDown from within the Editor control (not the Tree) so I wouldn't think this would suffer from the same problems as this post: http://ko.infragistics.com/community/forums/t/55171.aspx.
I like this simpler approach, but that still leaves me with two problems - the Refresh and the DropDown.
Thanks
Hi,
I'm sure I can help you get this working, but I need a little more information about how you have it set up.
Are you displaying the editor inside a cell in the tree? Or just in a standard node (with no columns)?
Are you using the same editor control for more than one node? Or does each node in the tree have it's own editor?