Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a template as defined below.
XML
<Grid removed="#01ffffff">
                <Grid Style="{StaticResource DataItemGridStyle}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition
                           Width="200" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition></RowDefinition>
                        <RowDefinition></RowDefinition>
                    </Grid.RowDefinitions>
                    <TextBlock
                        Grid.Row="0"
                        Grid.Column="0"
                        Text="{Binding Facility.FacilityName}"
                        Style="{StaticResource RowDataItemValueStyle}" 
                    />
                    <TextBox
                        Grid.Row="0"
                        Grid.Column="1"
                        x:Name="tbValue"
                        Text="{Binding Value, Mode=TwoWay}" TextChanged="tbValue_TextChanged" 
                    />
                    <!-- Send Mode -->
                    <ContentControl
                        Grid.Row="1"
                        Grid.Column="0"
                        Content="Send Mode"
                        Visibility="{Binding Text, ElementName=tbValue, Converter={StaticResource myStringToVisibilityConverter}, ConverterParameter='yes'}"
                        Style="{StaticResource ReqFieldLabelStyle}" />
                    <ComboBox 
                        x:Name="cbSendModeOverride"
                        Margin="0,5,0,0" 
                        Visibility="{Binding Text, ElementName=tbValue, Converter={StaticResource myStringToVisibilityConverter}, ConverterParameter='yes'}"
                        Width="400"
                        Grid.Row="3"
                        Grid.Column="2"
                        HorizontalAlignment="Left" SelectionChanged="ComboBox_SelectionChanged"
                        Loaded="cbSendMode_Loaded"
                        DisplayMemberPath="Code"
                    >
                    </ComboBox>
                </Grid>
            </Grid>

I need to be able to set the focus to the combobox from the textbox's textchanged event. Can someone please assist me? I've been looking for a solution for most of the day.
Posted
Updated 29-Jun-15 12:15pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900