Intersoft ClientUI Documentation
IsSelected Property
See Also  Send Feedback
Intersoft.Client.Framework Namespace > ISSelectionItemControl Class : IsSelected Property






Gets or sets a value that indicates whether the item is selected.

Syntax

Visual Basic (Declaration) 
<CategoryAttribute("Common Properties")>
Public Property IsSelected As Boolean
Visual Basic (Usage)Copy Code
Dim instance As ISSelectionItemControl
Dim value As Boolean
 
instance.IsSelected = value
 
value = instance.IsSelected
C# 
[CategoryAttribute("Common Properties")]
public bool IsSelected {get; set;}
Delphi 
public read-write property IsSelected: Boolean; 
JScript 
CategoryAttribute("Common Properties")
public function get,set IsSelected : boolean
Managed Extensions for C++ 
[CategoryAttribute("Common Properties")]
public: __property bool get_IsSelected();
public: __property void set_IsSelected( 
   bool value
);
C++/CLI 
[CategoryAttribute("Common Properties")]
public:
property bool IsSelected {
   bool get();
   void set (    bool value);
}

Example

The following example shows how IsSelected property works.

XAML Copy Code
<Intersoft:DockPanel HorizontalAlignment="Center" VerticalAlignment="Center">
        <Intersoft:UXListBox x:Name="ListBox1" HorizontalAlignment="Center" VerticalAlignment="Center">
                <Intersoft:UXListBoxItem Content="Item #1" IsSelected="True"/>
                <Intersoft:UXListBoxItem Content="Item #2"/>
                <Intersoft:UXListBoxItem Content="Item #3"/>
                <Intersoft:UXListBoxItem Content="Item #4"/>
        </Intersoft:UXListBox>
        <Intersoft:FieldLabel Intersoft:DockPanel.Dock="Top" Header="SelectedIndex">
                <TextBlock Text="{Binding SelectedIndex, ElementName=ListBox1}" Margin="4"/>
        </Intersoft:FieldLabel>
        <Intersoft:FieldLabel Intersoft:DockPanel.Dock="Top" Header="SelectedItem">
                <TextBlock Text="{Binding SelectedItem.Content, ElementName=ListBox1}" Margin="4"/>
        </Intersoft:FieldLabel>
        <Button Intersoft:DockPanel.Dock="Top" Content="Set Item #4.IsSelected = True" Margin="4" Click="Button_Click"/>          
</Intersoft:DockPanel>
C# Copy Code
private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
{
    ((UXListBoxItem)this.ListBox1.Items[3]).IsSelected = true;
}

This sample demonstrates that whenever the selection is changed, the item's IsSelected property is also synchronized. Similar to the previous sample, you can also use IsSelected property to control the selection.

Remarks

The item of a selection control is called Selection Item Control. This item control has IsSelected property that indicates whether the particular item is currently selected. Changing this property will also invalidate the whole selection process. This means that it will update the properties of the selection control such as SelectedIndex, SelectedItem, SelectedValue, etc.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2012 All Rights Reserved.