This is a migrated thread and some comments may be shown as answers.

jumpList and MVVM

1 Answer 95 Views
JumpList
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Felix
Top achievements
Rank 1
Felix asked on 07 Feb 2012, 07:03 PM
Hello

I´m traying to use juplist with MVVM


my VM it´s somthing like this 

 

private ObservableCollection<GenericGroupDescriptor<string, string>> _groupbyfirst;
public ObservableCollection<GenericGroupDescriptor<string, string>> GroupByFirst
{
    get { return _groupbyfirst; }
    set
    {
        _groupbyfirst = value;
        NotifyPropertyChanged("GroupByFirst");
    }
}
........
 GroupByFirst = new ObservableCollection<GenericGroupDescriptor<string, string>>();
GroupByFirst.Add(new GenericGroupDescriptor<string, string>(RazonSocial => RazonSocial.Substring(0, 1).ToLower()));
and my Model

<telerikDataControls:RadJumpList Grid.Row="1" x:Name="Clientes" ItemsSource="{Binding Clientes, Mode=TwoWay}"
               SelectedItem="{Binding Seleccionado, Mode=TwoWay}"
                
               GroupDescriptorsSource="{Binding GroupByFirst}"              
               FontSize="{StaticResource PhoneFontSizeMediumLarge}" Margin="0,50,0,0"
               ItemTemplate="{StaticResource ItemTemplate}">
               </telerikDataControls:RadJumpList >

I don´t Know what I doing wrong but I can´t group data.

There are anu example about this?

Thanks

1 Answer, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 10 Feb 2012, 10:01 AM
Hi Felix,

This is a quick follow-up to inform you that the Support ticket you have sent us has been handled.

In short, the issue was caused by type mismatch between the View Model property definition and the property defined by RadJumpList.

RadJumpList exposes the GroupDescriptorsSource property which is IEnumerable<DataDescriptor>, whereas your View Model exposes a property of type ObservableCollection<GenericGroupDescriptor>. The issue here is related to the difference between the GenericGroupDescriptor and DataDescriptor usage for the generic definition. ObservableCollection is IEnumerable which is OK, but since Generics are not inheritable, DataDescriptor is considered different from GenericGroupDescriptor, although the latter inherits from DataDescriptor.

I hope this helps.

Regards,
Deyan
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
JumpList
Asked by
Felix
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Share this question
or