Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ItemsControl.IsTextSearchCaseSensitive Property

Gets or sets a value that indicates whether case is a condition when searching for items.

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
public bool IsTextSearchCaseSensitive { get; set; }
<object IsTextSearchCaseSensitive="bool" .../>

Property Value

Type: System.Boolean
true if text searches are case-sensitive; otherwise, false.

When the IsTextSearchEnabled property is set to true, the IsTextSearchCaseSensitive property specifies whether the case determines whether an item is selected in an ItemsControl. For example, if an ItemsControl contain two strings that differ only in case, such as "ITEM" and "item", the first string will always be selected, regardless of the case of the input.

The following example creates a ComboBox that contains the strings, "DOG", "CAT", "dog", and "cat". The example binds the IsTextSearchCaseSensitive property to the IsChecked property of a CheckBox. If the check box is selected and the user types "dog", the third item in the ItemsControl is selected. If the user unselects the check box and types "dog", the first item is selected because case is not a condition of the search.

<StackPanel>

  <CheckBox Content="_Case sensitive Search" IsChecked="True"
            Name="caseSensitiveSearch"/>

  <ComboBox IsEditable="True"
            IsTextSearchCaseSensitive="{Binding 
              ElementName=caseSensitiveSearch, 
              Path=IsChecked}">
    <ComboBoxItem>DOG</ComboBoxItem>
    <ComboBoxItem>CAT</ComboBoxItem>
    <ComboBoxItem>dog</ComboBoxItem>
    <ComboBoxItem>cat</ComboBoxItem>
  </ComboBox>
</StackPanel>

.NET Framework

Supported in: 4.5.1, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft. All rights reserved.