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

Synchronize of Three Jumplist CheckedItems collections

2 Answers 35 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.
Cuneyt
Top achievements
Rank 1
Cuneyt asked on 23 Feb 2015, 08:59 AM
I have three jumplist ( multiselect with checkbox) in the different pivot item. If i select a few items in first jumplist, then i want to make second and third jumplist selected with first jumplist's checked items. how can we synchronize of these jumplists check items. what is the best solution. Could we bind of these jumplist's SelectedItem to each other.

Thank you.
    

2 Answers, 1 is accepted

Sort by
0
Cuneyt
Top achievements
Rank 1
answered on 23 Feb 2015, 11:07 PM
Ok i tried JumpListAZ_ItemCheckedStateChanged event. But threw an InvalidOperationException.
event is below:
private void HaraketListJumpListAZ_ItemCheckedStateChanged(object sender, ItemCheckedStateChangedEventArgs e)
       {
           if (e.IsChecked)
           {
               HaraketListJumpListEkipman.CheckedItems.Add(e.Item);
               HaraketListJumpListKas.CheckedItems.Add(e.Item);
           }
           else
           {
               HaraketListJumpListEkipman.CheckedItems.Remove(e.Item);
               HaraketListJumpListKas.CheckedItems.Remove(e.Item);
           }
            
            
       }


the error is:

{System.InvalidOperationException: Item already checked.
   at Telerik.Windows.Controls.CheckedItemsCollection`1.Add(T item)
   at FitnessPivot.HaraketListSelector.HaraketListJumpListAZ_ItemCheckedStateChanged(Object sender, ItemCheckedStateChangedEventArgs e)
   at Telerik.Windows.Controls.RadDataBoundListBox.OnItemCheckedStateChanged(Object item, Boolean isChecked)
   at Telerik.Windows.Controls.CheckedItemsCollection`1.Add(T item)
   at Telerik.Windows.Controls.RadDataBoundListBox.AddCheckedItem(DataSourceItem item)
   at Telerik.Windows.Controls.RadDataBoundListBox.HandleItemCheckStateChange(RadDataBoundListBoxItem item)
   at Telerik.Windows.Controls.RadJumpList.HandleItemCheckStateChange(RadDataBoundListBoxItem item)
   at Telerik.Windows.Controls.RadDataBoundListBox.OnItemTap(RadDataBoundListBoxItem item, UIElement container, UIElement originalSource, Point hitPoint)
   at Telerik.Windows.Controls.RadJumpList.OnItemTap(RadDataBoundListBoxItem item, UIElement container, UIElement originalSource, Point hitPoint)
   at Telerik.Windows.Controls.RadDataBoundListBoxItem.OnTap(UIElement container, UIElement originalSource, Point hitPoint)
   at Telerik.Windows.Controls.RadDataBoundListBoxItem.OnTap(GestureEventArgs e)
   at System.Windows.Controls.Control.OnTap(Control ctrl, EventArgs e)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)}

actually there is no item checked. 
0
Accepted
Ivaylo Gergov
Telerik team
answered on 26 Feb 2015, 10:06 AM
Hi,

This is the right approach. The only thing that you should have in mind is that the e.Item object is of type IDataSourceItem which the keeps business item in its Value property. In this case the code should look like this:

if (e.IsChecked)
           {
               HaraketListJumpListEkipman.CheckedItems.Add((e.Item as IDataSourceItem).Value);
               HaraketListJumpListKas.CheckedItems.Add((e.Item as IDataSourceItem).Value);
           }
           else
           {
               HaraketListJumpListEkipman.CheckedItems.Remove((e.Item as IDataSourceItem).Value);
               HaraketListJumpListKas.CheckedItems.Remove((e.Item as IDataSourceItem).Value);
           }

On our end everything works as expected. If this does not help, could you please send a sample project to reproduce the issue.

Regards,
Ivaylo Gergov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
JumpList
Asked by
Cuneyt
Top achievements
Rank 1
Answers by
Cuneyt
Top achievements
Rank 1
Ivaylo Gergov
Telerik team
Share this question
or