I have to make listbox with textbox in it... and it has to be dynamic. I have observable collection in code behind and I want to bind that for listbox. I want dynamic listbox an
If the items in your ObservableCollection
are just plain string
s, then you can data bind to the whole string value like this:
From the Binding.Path Property page on MSDN:
Optionally, a period (.) path can be used to bind to the current source. For example,
Text="{Binding}"
is equivalent toText="{Binding Path=.}"
.
Note that if you had some objects with properties in the collection, then @nit's answer would have been correct as you would need to reference the relevant property name: