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

RadRibbonGallery deselect item

6 Answers 171 Views
RibbonView and RibbonWindow
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 17 Oct 2012, 11:39 AM
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

6 Answers, 1 is accepted

Sort by
0
Accepted
Tina Stancheva
Telerik team
answered on 22 Oct 2012, 11:08 AM
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.

0
Michael
Top achievements
Rank 1
answered on 22 Oct 2012, 05:54 PM
Hi Tina,

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

With kind regards,

Michael
0
IT-Support
Top achievements
Rank 2
answered on 03 Apr 2015, 08:49 AM
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







0
IT-Support
Top achievements
Rank 2
answered on 03 Apr 2015, 10:24 AM
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();
        }
    }
0
Jatinder Singh
Top achievements
Rank 1
answered on 12 Jul 2016, 10:25 AM

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.

0
Martin
Telerik team
answered on 15 Jul 2016, 10:02 AM
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.
Tags
RibbonView and RibbonWindow
Asked by
Michael
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Michael
Top achievements
Rank 1
IT-Support
Top achievements
Rank 2
Jatinder Singh
Top achievements
Rank 1
Martin
Telerik team
Share this question
or