views:

244

answers:

0

Hello all I am trying to get the TextSearch.Textpath property to work within a WPF applcication but I am running into a wall on searching a bound field. Basically I have bound to some test data and I want to key the search off of the first property which contains a users ID. Here is the xaml I have so far:

<Window.Resources>
    <DataTemplate x:Key="ItemTemplate">     
        <StackPanel MinWidth="200">
            <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="16"/>
            <RowDefinition Height="25"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" MinWidth="72"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <TextBlock TextSearch.Text="{Binding Property1}" TextWrapping="Wrap" Text="{Binding Property1}" FontWeight="Bold"/>
        <Label Content="Name:" Grid.Row="1" ScrollViewer.VerticalScrollBarVisibility="Disabled" Grid.IsSharedSizeScope="True" Margin="28,0,0,0" Background="#00565656" Foreground="#FF626262"/>
        <TextBlock Grid.Column="1" Grid.Row="1" TextWrapping="Wrap" Text="TextBlock" Margin="0,5,0,3"/>
        <Label Content="Jurisdiction:" Grid.Row="2" ScrollViewer.VerticalScrollBarVisibility="Disabled" Grid.IsSharedSizeScope="True" Margin="0,1,0,0" Background="#00565656" Foreground="#FF626262" Height="25" VerticalAlignment="Top"/>
        <TextBlock Grid.Column="1" Margin="4,7,31,3" Grid.Row="2" TextWrapping="Wrap" Text="{Binding Property2}"/>
            </Grid>
        </StackPanel>
    </DataTemplate>
</Window.Resources>

<Grid x:Name="Base" Margin="0" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" DataContext="{Binding Source={StaticResource OfficerId}}">
    <Grid.RowDefinitions>
        <RowDefinition Height="0.066*"/>
        <RowDefinition Height="0.934*"/>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition/>
    </Grid.ColumnDefinitions>
    <ComboBox HorizontalAlignment="Left" IsEditable="True" Margin="8,8,0,5" Width="138" TextSearch.TextPath="Children[1].Children[0].Text" ItemTemplate="{DynamicResource ItemTemplate}" ItemsSource="{Binding Collection}" ToolTip="Select User" Text="Select User">


    </ComboBox>


</Grid>

When I run Window the combobox populates with data and the field is editable but when I type in a value nothing happens and if I select one of the options from the combobx a blank string is reterned in the combo bx.

Any tips would be appreciated.

Thank you

Randy