Xuni Controls > Input > ComboBox > Features > Data Binding |
The XuniComboBox class provides DisplayMemberPath and ItemsSource properties to bind the control to data. The DisplayMemberPath property sets the path to a value on the source object for displaying data, and the ItemsSource property lets you bind the control to a collection of items.
The following code snippet illustrates how to set these properties in code to achieve data binding.
C# |
Copy Code |
---|---|
this.cbxEdit.ItemsSource = array; this.cbxEdit.DisplayMemberPath = "Name"; |