Telerik RadListPicker control WP7

Jul 23, 2011 at 11:08 AM

I have a Telerik RadListPicker control and I realise that I have to add a custom convention to get it to work below is my attempt but unfortunately it doesn't work. Well it half works, my view loads but doesn't display anything in the control upon clicking the control however I can see all the values of the List<string> that I have created.

ConventionManager
                .AddElementConvention<RadListPicker>(RadListPicker.ItemsSourceProperty, "ItemsSource", "SelectionChanged")
                .ApplyBinding =
                (viewModelType, path, property, element, convention) =>
                {
                    if (!ConventionManager.SetBinding(viewModelType, path, property, element, convention))
                        return false;

                    var listpickerControl = (RadListPicker)element;

                    ConventionManager.ConfigureSelectedItem(element, RadListPicker.SelectedItemProperty, viewModelType, path);

                    if (string.IsNullOrEmpty(listpickerControl.DisplayMemberPath))
                        ConventionManager.ApplyHeaderTemplate(listpickerControl,
                                                                RadListPicker.ItemTemplateProperty,
                                                                viewModelType);
                    return true;
                };

I can't seem to figure out if its something I've done in the custom convention or something wrong in my viewmodel. The reason I say that is because I'm getting an unusal message in my output window

System.Windows.Data Error: BindingExpression path error: 'DisplayName' property not found on 'driver' 'System.String'...

Any ideas would be much appreciated.


Jul 29, 2011 at 11:12 PM

It's a hard to guess. I'm not familiar with RadListPicker; I suppose it is functionally equivalent to a ComboBox, am I correct?
I would try getting things squared with regular explicit bindings, first, then build a convention around it.