RadRibbonGallery deselect item

7 posts, 1 answers
  1. Michael
    Michael avatar
    6 posts
    Member since:
    Sep 2011

    Posted 17 Oct 2012 Link to this post

    Hello,

    I have a RadRibbonGallery bound to a collection of business objects in my view model. When I select an item in the gallery, an action is triggered and after that action, the item in the RibbonGallery should be deselected, so the user can select the same item again.

    I tried to implement this by two-way binding the SelectedItem property of the RibbonGallery and in the property setter, set the value to null.

    However, selecting works, but setting the SelectedItem to null does not deselect the item.

    Is there another way to deselect? I also tried binding to both SelectedItem and SelectedIndex and set the SelectedIndex to -1, but it does also not deselect.

    Thanks in advance,

    Michael
  2. Answer
    Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 22 Oct 2012 Link to this post

    Hi Michael,

    In order to implement the described scenario, it's better to bind the IsSelected property of the RadGalleryItems to a property from your view model and control their selected state from there.

    I attached a sample solution to get you started. Please take a look at it and let me know if it helps.

    All the best,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Michael
    Michael avatar
    6 posts
    Member since:
    Sep 2011

    Posted 22 Oct 2012 Link to this post

    Hi Tina,

    thanks for the sample, i have modified my code and it works that way.

    With kind regards,

    Michael
  5. IT-Support
    IT-Support avatar
    9 posts
    Member since:
    Dec 2011

    Posted 03 Apr 2015 Link to this post

    Hi, 

    old topic, but I still have a problem with the deselection of a RadGalleryItem. The sample solution works, but only if you select different items.

    When you select an item by clicking on it, the item is selected and immediately deselected because the setter of DataItem.Selected is called. But when you click on the same item again, the setter is not called again.

    My guess is, that the RadRibbonGallery memorizes the selected item and does nothing, when the selected item is selected again - even when DataItem.Selected states "false". 

    Is there a way that the setter of the Selected property is called again when item is clicked twice?

    Best regards,
    Thomas







  6. IT-Support
    IT-Support avatar
    9 posts
    Member since:
    Dec 2011

    Posted 03 Apr 2015 in reply to IT-Support Link to this post

    I have found a workaround by creating a derived ribbon gallery:


    public class OptionsGallery : RadRibbonGallery
        {
            protected override void OnSelectionChanged(SelectionChangedEventArgs e)
            {
                base.OnSelectionChanged(e);
                SelectionHelper.ClearSelection();
            }
        }
  7. Jatinder Singh
    Jatinder Singh avatar
    3 posts
    Member since:
    Feb 2013

    Posted 12 Jul Link to this post

    Hello,

    we are using RadRibbonGallery Control of Telerik in this the tooltip  for scroller is not shown proper.
    After Pagedown when we click on pageup 
    tooltip is displaying Row 2 of 4 instead of  Row 3 of 4.
    I am attaching the screenshots.

    Thanks in Advance.

  8. Martin
    Admin
    Martin avatar
    63 posts

    Posted 15 Jul Link to this post

    Hello Jatinder,

    I cannot seem to reproduce your current problem. Could I ask you to provide some additional information, version of the assemblies you are using,  runnable snippets or an isolated project. Since this issue is unrelated to the thread, I could suggest you opened a new support thread so you can freely attach files.

    Regards,
    Martin
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for WPF is Visual Studio 2017 Ready