With WPF Toolkit DataGrids I could have a binding on a list view which looked like:
Binding="{Binding}"
This would mean that the ToString() method on the relivant object in the bound collection would be called and displayed.
On Telerik controls if I perform a binding such as:
DataMemberBinding="{Binding}":
Then I do not see this behaviour. Is this feature missing from your controls or do I have to approach this in another way? This is something I would really like to be able to do as it allows me to display composite data in a single field.
Thanks
4 Answers, 1 is accepted
That is definitely not true.
Please check out the sample project that I have attached.
Ross
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

The particular binding I'm having a problem with is on a GridViewComboBoxColumn, see below:
<
telerik:GridViewComboBoxColumn
Width
=
"75"
IsReadOnly
=
"False"
Header
=
"VAT"
CellStyle
=
"{StaticResource RadGridEditableCellStyle}"
ItemsSource
=
"{Binding Source={StaticResource VatCodesSource}}"
DisplayMemberPath
=
"{Binding}"
SelectedValueMemberPath
=
"VatId"
DataMemberBinding
=
"{Binding VatId, UpdateSourceTrigger=PropertyChanged}"
/>
The result of this was a combobox with a number of blank items, even though the ToString() method on the bound type returns values along the lines of "S (20.00%)"
However (and this is where it gets a little strange), after my first post I decided, as a temporary measure, to bind to a property called "Rate" on the combos ItemsSource binding and StringFormat this, expecting the result to be along the lines of "20.00". However what actually happened was that the ToString() method seems to have been called (I'm assuming because of the StringFormat) on the bound object so I got the results I hoped for in the first place, i.e. "S (20.00%)".
<
telerik:GridViewComboBoxColumn
Width
=
"75"
IsReadOnly
=
"False"
Header
=
"VAT"
CellStyle
=
"{StaticResource RadGridEditableCellStyle}"
ItemsSource
=
"{Binding Source={StaticResource VatCodesSource}}"
DisplayMemberPath
=
"{Binding Rate, StringFormat=F2}"
SelectedValueMemberPath
=
"VatId"
DataMemberBinding
=
"{Binding VatId, UpdateSourceTrigger=PropertyChanged}"
/>
While I've now got the results I wanted in the first place could you investigate this particular scenario? I don't really want to leave my code like this as it may become problematic in the future.
Thanks for your help
As it name implies, the DisplayMemberPath is a Path and not a Binding.
You should specify that you want the entire object (i.e. ToString()) like this:
DisplayMemberPath="."
The dot means no path, i.e. give me the whole object.
Please, read this in case you have not.
Ross
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
