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

How to use a custom Lookup Property Editor control for reference properties in WinForms

$
0
0

How to use a custom Lookup Property Editor control for reference properties in WinForms

FEATURES

LookupPropertyEditorEx This is a regular XAF PropertyEditor class that can be used for referenced properties instead of the standard LookupPropertyEditor in Windows Forms applications. By default, this editor allows you to choose a value from the drop down list. It's possible to find the required record in the drop down list by typing text (auto-incremental search). If you want to clear a value, use either the Control+Delete keystroke or click the minus (-) button. If you want to add a new object, click the plus (+) button. It will show a modal DetailView allowing you to fill object properties and save it.

IMPORTANT NOTES

From this example, you need use only one assembly (the WinSolution from the example is just a demo application, and it has no relation to the solution): Editors.Win.dll Since this is a regular XAF module, you should add this module to your application to be able to use its features. In case of standard modules, you add them from the Toolbox via the Application or Module designer. Since we deal with a custom module, you should add this into the Toolbox manually. Please refer to the How to: Add Items to the Toolbox article in MSDN, for more details. Alternatively, you can take the source code and include it in your solution.

The LookupPropertyEditorEx is set as default for all lookup properties in the application. If you want to change this, then invoke the Model Editor for the Windows Forms application project or module, and change the EditorType property of the DetailViewItems | PropertyEditors | LookupProperty node. Or, change the PropertyEditorType property for a class member, ListView column or DetailView item nodes individually.

See Also:

Implement Custom Property Editors 
PropertyEditors.Lookup - How to provide alternative data representations for reference lookup properties (e.g., a simple drop-down box, a complex multi-column grid, or a tree view)

Question Comments

Added By: Carlitos at: 8/18/2012 7:29:01 AM    

I'm not able to see E1101. When I try it says: You can't view this question because it is marked as private.

Added By: Gustavo Marzioni at: 8/27/2012 2:45:42 PM    

it doesn't work when you create several hundred of Demolookup objects

Added By: ASM at: 9/11/2012 10:30:56 PM    

E1101 is still marked as private...

Added By: Jeffrey E at: 12/13/2015 3:50:53 AM    

Hi Support,

I tried this example, but I noticed that when I input in the lookupedit for instance I input letter P, instead letter N appeared. Please see the screenshot - http://screencast-o-matic.com/watch/colIXChv40. I want to make the lookupedit a search text, I removed the arrow button then autofilter.

Thanks.

Added By: Dennis (DevExpress Support) at: 12/14/2015 4:59:41 AM    

@Jeffrey: To process your recent post more efficiently, I created a separate ticket on your behalf: T324200: E1101 auto-filter behavior.

Added By: Michael Bogaerts at: 12/14/2015 11:43:50 PM    

Dennis,
Is it hidden for a particular reason?

Added By: Dennis (DevExpress Support) at: 12/15/2015 12:29:51 AM    @Michael: Yes.

Viewing all articles
Browse latest Browse all 7205

Trending Articles



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