I have always struggled with those comboBox properties
- DisplayMemberPath < Li> Selected value
- Selected valuepath
I am creating a master extension form
- Customer-filled combo box < / Li>
- User selects a customer in the combo
- Fills all textboxes
The problem is that I have worked it but I Do not understand the properties and differences Come. Do they tell what they are doing? You might think that it is self explanatory. I do not.
Thank you for your input
I think we have an example It can understand better. View this category:
Public Class Employees {Public Ent ID (Received); Set; } Public string name {get; Set; }}
and the following xaml:
& lt; Combo box itemsource = "{binding source = {static resource employee}}" DisplayMemberPath = "name" selected valueup = "id" /> DisplayMemberPath
property name
indicates property, therefore the value displayed in ComboBox
and employee
The entries contained in the drop down list will be the property of the name
employee
item.
To understand the other two, you should first understand SelectedItem
. Selected item
will return the currently selected employee
object to combobox
. You can assign SelectedItem
with an employee
object to set the current code to combo box
.
indicates SelectedValuePath id
, which means that you use id
currently selected employee
You can get SelectedValue
. You can set the currently selected employee
in ComboBox
to SelectedValue
on an Id
(which we believe to be employees
will be present in the list).
Comments
Post a Comment