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

RadJumpList.ItemsSource

3 Answers 51 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.
Paras
Top achievements
Rank 1
Paras asked on 31 Jul 2013, 07:19 AM
I have a RadJumpList control on my page in a WP7.x application. The ItemTemplate for this control is set to a complex structure like below:

<telerikDataControls:RadJumpList.ItemTemplate>
 <DataTemplate>
  <Grid>
   <Image Name="img1" />
   <TextBlock Name="tbVal1" />
   <TextBlock Name="tbVal2" />
   <TextBlock Name="tbVal3" />
  </Grid>
 </DataTemplate>
</telerikDataControls:RadJumpList.ItemTemplate>

From what I can tell the RadJumpList.ItemsSource property can only be set to a List<string>. How do I accomplish the task of assigning a value for all the controls in the ItemTemplate while limited to List<string> only? I was hoping to assign a List<MyClass> to the ItemsSource property where 'MyClass' contains elements/properties for all the controls in the ItemTemplate.
 

Regards,

Paras Wadehra

Nokia Developer Ambassador

INETA Community Champion

Twitter: @ParasWadehra

FB: FB.com/WindowsPhoneDeveloper

My WP Apps

 

3 Answers, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 31 Jul 2013, 11:06 AM
Hi Paras,

The ItemsSource property of the RadJumpList can be set to a collection of any type of object. Please refer to the attached project and let me know if it helps. I'd be glad to assist you further. 

Regards,
Kiril Stanoev
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINDOWS PHONE 7.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Paras
Top achievements
Rank 1
answered on 03 Aug 2013, 09:14 AM
Hi Kiril,

While your sample solution works, my project still throws an error like:

System.InvalidCastException was unhandled by user code
  HResult=-2147467262
  Message=Unable to cast object of type 'Namespace.Class' to type 'System.String'.
  Source=System.Core
  StackTrace:
       at System.Linq.Enumerable.<CastIterator>d__b1`1.MoveNext()
       at System.Linq.Lookup`2.Create[TSource](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
       at System.Linq.GroupedEnumerable`4.GetEnumerator()
       at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
       at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__0.MoveNext()
       at Telerik.Windows.Data.GroupProcessor.ProcessCore(IEnumerable data)
       at Telerik.Windows.Data.DescriptorProcessor.Process(IEnumerable data)
       at Telerik.Windows.Data.RadCollectionView.CreateView()
       at Telerik.Windows.Data.RadCollectionView.RefreshOverride()
       at Telerik.Windows.Data.RadCollectionView.Refresh()
       at Telerik.Windows.Data.RadCollectionView.OnResumed(Boolean update)
       at Telerik.Windows.Controls.SuspendableObject.Resume(Boolean update)
       at Telerik.Windows.Data.RadCollectionViewSource.RefreshOverride()
       at Telerik.Windows.Data.RadListSource.Refresh()
       at Telerik.Windows.Data.RadListSource.AttachData(IEnumerable data)
       at Telerik.Windows.Data.RadListSource.SetSource(IEnumerable value)
       at Telerik.Windows.Data.RadListSource.set_SourceCollection(IEnumerable value)
       at Telerik.Windows.Controls.RadDataBoundListBox.OnItemsSourceChanged(IEnumerable oldSource)
       at Telerik.Windows.Controls.Primitives.DataControlBase.OnItemsSourceChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
       at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
       at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
       at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       at Telerik.Windows.Controls.Primitives.DataControlBase.set_ItemsSource(IEnumerable value)
       at System.Net.WebClient.OnOpenReadCompleted(OpenReadCompletedEventArgs e)
       at System.Net.WebClient.OpenReadOperationCompleted(Object arg)
  InnerException:

Any ideas?
0
Paras
Top achievements
Rank 1
answered on 04 Aug 2013, 03:26 AM
Lance McCarthy helped me with this issue offline. A big thanks to him!
Tags
JumpList
Asked by
Paras
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Paras
Top achievements
Rank 1
Share this question
or