jumpList and MVVM

Thread is closed for posting
2 posts, 0 answers
  1. Felix
    Felix avatar
    4 posts
    Member since:
    Feb 2012

    Posted 07 Feb 2012 Link to this post


    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; }
            _groupbyfirst = value;
     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?

  2. Deyan
    Deyan avatar
    2147 posts

    Posted 10 Feb 2012 Link to this post

    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.

    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top