ComboBox GotFocus does not fire first by InvokeCommandAction on CellEditingTemp

Posted by: info on 18 April 2021, 12:04 pm EST

  • Posted 18 April 2021, 12:04 pm EST

    Hello.

    C1.WPF.Grid.Ja 5.0.20203.37
    Microsoft.Xaml.Behaviors.Wpf 1.1.31
    ReactiveProperty 7.8.3

    DataGird:
    ComboBox GotFocus fires first by InvokeCommandAction

                        <DataGridTemplateColumn.CellEditingTemplate>
    <DataTemplate>
    <ComboBox Width="100" VerticalAlignment="Stretch">
    <bh:Interaction.Triggers>
    <bh:EventTrigger EventName="GotFocus">
    <bh:InvokeCommandAction Command="{Binding ComboBoxFocus, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" PassEventArgsToCommand="True" />
    </bh:EventTrigger>
    </bh:Interaction.Triggers>
    <ComboBoxItem>Item A</ComboBoxItem>
    <ComboBoxItem>Item B</ComboBoxItem>
    <ComboBoxItem>Item C</ComboBoxItem>
    </ComboBox>
    </DataTemplate>
    </DataGridTemplateColumn.CellEditingTemplate>


    c1:FlexGrid
    ComboBox GotFocus does not fire first by InvokeCommandAction.

    I need to use MVVM. So I'd like to use InvokeCommandAction.
    Will it be fixed?

    CategoryOnGrid.zip
  • Replied 18 April 2021, 9:24 pm EST

    Hi Mikihiro,

    Thank you for sharing the sample.

    This behavior seems like a bug so I have escalated it to the devs and will get back to you when there is any update. (Internal Tracking Id - C1XAML-27333)

    Best Regards,
    Kartik
  • Replied 18 April 2021, 9:32 pm EST

    Thank you for your help.
    I will wait.
  • Marked as Answer

    Replied 27 April 2021, 4:39 pm EST

    Hi Mikihiro,

    As per the devs, you can set the EventTrigger's SourceObject property to the ComboBox itself in order to overcome this behavior as follows:
    <bh:EventTrigger EventName="GotFocus" SourceObject="{Binding ElementName=comboBox}">

    Please refer to the same from the attached modified sample. (see CategoryOnGrid_Mod.zip)

    Best Regards,
    Kartik

    CategoryOnGrid_Mod.zip
  • Replied 2 May 2021, 8:03 pm EST

    I understand. Thank you.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels