Export (0) Print
Expand All

TextSearch.TextPath Attached Property

Gets or sets the name of the items' property that identifies each item in a control's collection.

Namespace: System.Windows.Controls
Assembly: PresentationFramework (in PresentationFramework.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

See TextSearch.GetTextPath, TextSearch.SetTextPath
See TextSearch.GetTextPath, TextSearch.SetTextPath
See TextSearch.GetTextPath, TextSearch.SetTextPath
<object TextSearch.TextPath="string" .../>

Property Value

The name of the property that contains the text that identifies the item to the user. The default value is an empty string.

Identifier field

TextPathProperty

Metadata properties set to true

None

Use this property on a control that contains a collection of items. The value of the specified property is the text that the user can type to select the item, and the text that is displayed if the control is set to display text in its TextBox. If you set the Text property on a control's collection item, the TextPath property will be ignored. If you set the TextPath property to a value that is not the name of an actual property, TextPath is ignored.

The following example creates a ComboBox that contains images as items instead of text. The IsEditable property is set to true, so text is displayed when one of the images is selected.

<ComboBox IsEditable="true" TextSearch.TextPath="Name">
      <Image Name="Cat" Source="data\cat.png"/>
      <Image Name="Dog" Source="data\dog.png"/>
      <Image Name="Fish" Source="data\fish.png"/>
</ComboBox>

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Community Additions

ADD
Show:
© 2014 Microsoft