Click here to Skip to main content
Click here to Skip to main content

Build lookup control using visual studio 2005

, 22 Oct 2005
Rate this:
Please Sign up or sign in to vote.
Custom editors in building user controls

Sample Image - LookupScreenShot.jpg

Introduction

In this article I tried to illustrate how it's easy to develop custom user control with different types of property editors and how to make custom data binding property in visual studio 2005 beta and visual c#

 

While building this control, I tried to be as close as possible to the MVC (Model / View / Controller) pattern

Control Model

Model

All the selection statement are based on the INFORMATION_SCHEMA system view, so that I can gain full compliance with Sql Server 2000 and Sql Server 2005

 

Drop Down Editors

 

We only need to specify UITypeEditorEditStyle.DropDown in the edit style override

 

I had a problem that I needed to access another property of the user control ( The Sql Connection already defined by developer) , I found a very handy reference which is context.Instance which I got it in edit value override , that I casted to my user control class 

Modal Dialog Editor

Just specify UITypeEditorEditStyle.Modal in the edit style override , the control illustrates that you can easily embed any form as your dialog in Visual Studio

 

Usage

 

Developer should specify the SqlConnection property , then the table name , optionally he/she has to specify the table schema ( used heavily in Adventure Works sample database that shipped with Sql Server 2005 Beta ) , finally he has to select the columns that appear to the users in the lookup dialog

 

Achnowledgment

 

Thanks to the article "Creating Custom Controls-Providing Design Time Support 1 " By Kodanda Pani as it was a good starting point for me

 

History

 

Initial version on 22-10-2005

 

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Waleed Zedan
Web Developer
Egypt Egypt
No Biography provided

Comments and Discussions

 
GeneralMy vote of 2 Pinmemberspan23728-Mar-10 12:17 
GeneralLookup control Pinmembermarkop20-Oct-07 23:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140709.1 | Last Updated 22 Oct 2005
Article Copyright 2005 by Waleed Zedan
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid