Version

IsSelected Property (GalleryItem)

Returns/sets whether this GalleryItem is the selected item in the GalleryTool.
Syntax
'Declaration
 
Public Property IsSelected As Boolean
public bool IsSelected {get; set;}
Remarks

Note: If the GalleryItem is selected and it has been assigned to multiple GalleryItemGroups, it will appear selected in each of those GalleryItemGroups.

Example
The following example shows how to use the IsSelected property to specify whether this GalleryItem is the selected item in the GalleryTool.

Imports System
Imports System.Windows
Imports Infragistics.Windows.Ribbon


Namespace MyNamespace
    Public Partial Class MyWindow
        Inherits XamRibbonWindow
        Public Sub New()
            InitializeComponent()
        End Sub
       
        Protected Sub LoadGalleryTool()
            Dim item As New GalleryItem()
            item.Key = "Item1"
            item.Text = "First Item"
            item.Image = New BitmapImage(New Uri("\Images\ig_office_icon_16.png", UriKind.Relative))
            item.IsSelected = True
           
            galleryTool.Items.Add(item)
        End Sub
    End Class
End Namespace
using System;
using System.Windows;
using Infragistics.Windows.Ribbon;


namespace MyNamespace
{
    public partial class MyWindow : XamRibbonWindow
    {
        public MyWindow()
        {
            InitializeComponent();
        }

        protected void LoadGalleryTool()
        {
            GalleryItem item = new GalleryItem();
            item.Key = "Item1";
            item.Text = "First Item";
            item.Image = new BitmapImage(new Uri("\\Images\\ig_office_icon_16.png", UriKind.Relative));
            item.IsSelected = true;

            galleryTool.Items.Add(item);
        }
    }
}
<igRibbon:XamRibbonWindow x:Class="MyWindow"
    
xmlns:igRibbon="http://infragistics.com/Ribbon"
    
xmlns:s="clr-namespace:System;assembly=mscorlib">

  ....

  
        
<igRibbon:RibbonGroup Id="groupId" Caption="Group">
            
<igRibbon:MenuTool ShouldDisplayGalleryPreview="True" Caption="GalleryToolMenu">
                
<igRibbon:GalleryTool Name="galleryToolItems" >
                    
<igRibbon:GalleryTool.Items> 
                        
<igRibbon:GalleryItem Key="Item1" Text="First Item" Image="\Images\ig_office_icon_16.png" IsSelected="True"/>
                    
</igRibbon:GalleryTool.Items>
                
</igRibbon:GalleryTool>
            
</igRibbon:MenuTool>
        
</igRibbon:RibbonGroup> 

  ....

</igRibbon:XamRibbonWindow>
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also