Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1140
Cell Control Focus On Activate Custom Data Template
posted

Ok, I have an unusual scenario here, one of my users requested an autocomplete style combobox column.  I have pieced together one from some examples I have found online.  Unfortunately for me this is all smoke and mirrors and I ended up with an autocomplete box on top of a combo box databound to the same source.  When the cell is activated I would like the autocomplete box to enter edit mode.  I have tried to use the VisualTreeHelper to traverse the cell control when the activecellchanging event is fired to no avail.  Any suggestions?

MARKUP:

<igGrid:TemplateColumn HeaderTex<igGrid:TemplateColumn HeaderText="Absence Code" Key="ABSValue">  
<igGrid:TemplateColumn.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding ABSValue}"/>
</DataTemplate>
</igGrid:TemplateColumn.ItemTemplate>
<igGrid:TemplateColumn.EditorTemplate>
<DataTemplate>
<Grid IsHitTestVisible="True" Grid.Column="1" Grid.Row="1" Grid.RowSpan="1">
<ComboBox IsTabStop="False" x:Name="AbsCombo" HorizontalAlignment="Left" Width="100" SelectionChanged="AbsCombo_SelectionChanged"
ItemsSource="{Binding Source={StaticResource AbsRecords}}"
DisplayMemberPath="AbsCode">
</ComboBox>
<input:AutoCompleteBox TabIndex="2" IsTabStop="True" x:Name="AbsCompleteBox" HorizontalAlignment="Left"  Width="80"
ItemsSource="{Binding Source={StaticResource AbsRecords}}"
ValueMemberPath="AbsCode" TextChanged="AbsCompleteBox_TextChanged">
<input:AutoCompleteBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding AbsCode, Mode=TwoWay}"/>
</DataTemplate>
</input:AutoCompleteBox.ItemTemplate>
</input:AutoCompleteBox>
</Grid>
</DataTemplate>
</igGrid:TemplateColumn.EditorTemplate>
</igGrid:TemplateColumn>