Language: C#
Bind a (DevExpress) ComboBox from a Dictionary
enum ReportTypes { Country, CountryState, CountryStateZone, CountryStatePostCode, CountryZone, CountryStateCounty } var reportTypes = new Dictionary<int, string> () { {(int)ReportType.Country, "By Country"}, {(int)ReportType.CountryState, "By Country, State"}, {(int)ReportType.CountryStateZone, "By Country, State, Zone"}, {(int)ReportType.CountryStatePostCode, "By Country, State, Postal code"}, {(int)ReportType.CountryZone, "By Country, Zone"}, {(int)ReportType.CountryStateCounty, "By Country, State, County"}, }; // Bind to control cboReportType.Properties.ValueMember = "Key"; cboReportType.Properties.DisplayMember = "Value"; cboReportType.Properties.DataSource = reportTypes.ToList();
Tags:
Report Abuse
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search

