Click here to Skip to main content
15,896,154 members
Articles / Programming Languages / C#

Data Binding an Enum with Descriptions

Rate me:
Please Sign up or sign in to vote.
4.46/5 (67 votes)
30 Dec 2007CPOL4 min read 305.7K   2.6K   159  
A simple solution for binding an enum to a UI control using data binding.
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{68D86AAC-65F0-4826-934B-612CEEB14477}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Campari.Software.Core", "Campari.Software.Core\Campari.Software.Core.csproj", "{EDF09C0E-A164-4D4D-B6D0-5645B782ECD5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tester", "..\extras\Tester\Tester.csproj", "{8C221C12-9BF0-421C-AB10-C3942050C2DA}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{EDF09C0E-A164-4D4D-B6D0-5645B782ECD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{EDF09C0E-A164-4D4D-B6D0-5645B782ECD5}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{EDF09C0E-A164-4D4D-B6D0-5645B782ECD5}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{EDF09C0E-A164-4D4D-B6D0-5645B782ECD5}.Release|Any CPU.Build.0 = Release|Any CPU
		{8C221C12-9BF0-421C-AB10-C3942050C2DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{8C221C12-9BF0-421C-AB10-C3942050C2DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{8C221C12-9BF0-421C-AB10-C3942050C2DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{8C221C12-9BF0-421C-AB10-C3942050C2DA}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
	GlobalSection(DPCodeReviewSolutionGUID) = preSolution
		      DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
	EndGlobalSection
EndGlobal

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
I am a Microsoft C# MVP, author, speaker, blogger, and software developer. I also created the WP Requests and WinStore Requests sites for Windows Phone and Windows Sotre apps as well as several open source projects.

I've been involved with computers in one way or another for as long as I can remember, but started professionally in 1993. Although my primary focus right now is commercial software applications, I prefer building infrastructure components, reusable shared libraries and helping companies define, develop and automate process and code standards and guidelines.

Comments and Discussions