Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to create an analog of GridLookUpEdit with TreeList in a popup window

$
0
0

This example is obsolete. We've included the TreeListLookUpEdit editor in our suite in version 13.1.


In some cases, it is useful to display data within LookUpEdit in the hierarchical structure.

This can be introduced by creating a custom editor – TreeListLookUpEdit.

This example illustrates how to create such an editor.

Here we have implemented the following features:


- The RepositoryItemTreeListLookUpEdit.ValueMember and RepositoryItemTreeListLookUpEdit.DisplayMember properties. They are intended for the same functions as in a regular LookUpEdit/GridLookUpEdit.

- The ProcessNewValue event is implemented like in LookUpEdit/GridLookUpEdit. This event is raised when an editor is validated and its display value does not exist within an inner TreeList.

- The property SearchMode allows you to select one of the following modes:

     o OnlyInPopup. This mode is an analog of IncrementalSearch, but it also expands nodes if it is needed when you type a search text. This mode works only if a popup window is shown.

     o AutoComplete. In the Auto Completion mode, the text in the edit box is automatically completed if it matches a DisplayMember field value from drop-down nodes.

     o AutoFilter. This mode applies a filter to the DisplayMember column. Filter is formed when you type a text in the edit box. In addition, it opens a popup window and looks for nodes retaining paths to the root to show the context.

For virtual data loading (on demand) in the inner TreeList you can handle its BeforeExpand event. Please refer to the following help articles:


How to: Implement Dynamic Loading in Unbound Mode
Dynamic Data Loading via Events
How to: Implement a Tree Structure for a Business Object

 to learn which virtual Modes TreeList supports.

Question Comments

Added By: (no info) at: 3/18/2013 6:00:11 AM    

Hi,

I'm Trying to make my custom control TreeListLookUpEdit and everything goes fine except this line: (DXCategory is not defined...)
<DXCategory(CategoryName.Behavior), DefaultValue(SearchMode.OnlyInPopup)> _

¿Any solution for this?

Thanks,
Iker.

Added By: (no info) at: 3/26/2013 4:27:57 AM    

I'm using the 12.1.5 versión of DevExpress, may be this the problem?


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>