Build a Countries List with Telerik UI for WinForms DomainUpDown
以下为 快照 页面，建议前往来源网站查看，会有更好的阅读体验。
In this blog post, you will learn more about the DomainUpDown control in Telerik UI for WinForms and how to use it to build a selection list for countries.
RadDomainUpDownin Telerik UI for WinForms is a combination of a text-box and a pair of moving up and down buttons to navigate through a limited selection of options.This controlmay save you some screen space since it occupies the space needed for a standard text-box. However, in addition, it allows the end user to select one of a variety of several items.
A common use-case is to build an input form for filling personal information. One of the required fields is the nationality. RadDomainUpDown is suitable for introducing the countries options if you don’t want to allocate a lot of space on the form.
Adding Countries to the DomainUpDown Control
You can add the country items either at design time or at run time.
Adding Items at Design Time
The RadListDataItem Collection Editor allows you to do that. You can access it through the Smart tag >> Edit Items option:
Adding Items at Run Time
For each country option, add a RadListDataItem to the Items collection that RadDomainUpDown offers:
RadListDataItem item1 =
RadListDataItem item2 =
RadListDataItem item3 =
Adding Flags to the Countries
Open the project’s Resources and add the flags for the countries that you have added:
Adding Country Flags at Design Time
Open the RadListDataItem Collection Editor again and assign an image to each RadListDataItem :
Adding Country Flags at Run Time
Set the Image property for each RadListDataItem :
item1.Image = Properties.Resources.BUL;
item2.Image = Properties.Resources.FR;
item3.Image = Properties.Resources.ITA;
The last thing to do is to set the ReadOnly property to true . Thus, the item’s image will be shown next to the text after making a selection:
Set the Wrap property to true if you need the selected item to revert to the first item after reaching the last item and vice versa.
The SelectedIndexChanging event allows you to control whether the newly selected item is valid according to the other fields’ input, e.g. selected town. If the selection is not valid simply set the Cancel argument to true :
Try It Out and Share Your Feedback
You can learn more about the Telerik UI for WinForms suite via theproduct page. It comes with a 30-day free trial, giving you some time to explore the toolkit and consider using it for your current or upcoming WinForms development.
We would love to hear what you think, so should you have any questions and/or comments, please share them to ourFeedback Portal.
Check out everything that's new in Telerik UI for WinForms with the R2 2019 release. During the middle of the spring the new R2 2019 release is flourishing. It brings a diverse set of components, new features and...
Check out the latest features and fixes just released in the service pack for Telerik UI for WinForms, including improved dialogs and searching. Along with several new features, we've introduced 40 important bug...
Your feedback has always been our main priority. We focused on addressing the issues you reported in our R3 2019 Service Pack, delivering 30 fixes in total. I am happy to share that the R3 2019 Service Pack rele...
Along with the announcement of new controls, the R3 2019 release for Telerik UI for WinForms brings powerful new features for the File Dialogs . Let’s take a look at the new upgrades. ...
Enjoy over 20 enhancements and fixes with Telerik UI for WinForms R2 2020 Service Pack, as well as more development on the Telerik .NET Core WinForms designer! In the month following our latest major release, th...
In May we reported Microsoft wants to run WinForms and WPF on .NET Core 3.0 . In order to facilitate this, they are building a new tool that will al...
README.md Windows Forms
Yes, WPF has been around for a while As part of today’s Connect(); virtual event for developers, Microsoft announced t...
README.md WasmWinforms Winforms now work in your browser! WasmWinforms is a nuget package that you can install and use your EXACT same code designed fo...
This post will help you deploy and bring your finished app to your users. NET Core 3 gives us three ways to deploy an app, and each has its benefits. I know that the real fun is while an app is being developed, a...