Home Forums WPF controls Xceed DataGrid for WPF KeyBinding for Enter key does not work

Viewing 1 post (of 1 total)
  • Author
    Posts
  • HanzieV
    Participant
    Post count: 13
    #44907 |

    I’m using the free version of the XCeed DataGrid (version 3.1.0). I’m trying to set up a Keybinding for the Enter key. Here’s my code:

    <dg:DataGridControl x:Name=”mainDataGrid” ItemsSource=”{Binding MainCollectionView}” AutoCreateColumns=”False”
    SelectedItem=”{Binding CurrentModel}” SynchronizeCurrent=”True” ReadOnly=”True”
    bx:DataGridDoubleClickCommand.DoubleClickCommand=”{Binding MainDataGridDoubleClickCmd}”>

    <dg:DataGridControl.InputBindings>
    <KeyBinding Key=”Enter” Command=”{Binding MainDataGridDoubleClickCmd}”/>
    </dg:DataGridControl.InputBindings>

    <dg:DataGridControl.Columns>
    <dg:Column Title=”{bx:LocalizeBinding ID, Global=True}” FieldName=”UserID” Width=”70″/>
    <dg:Column Title=”{bx:LocalizeBinding Name, Global=True}” FieldName=”Name” Width=”200″/>
    <dg:Column Title=”{bx:LocalizeBinding FirstName, Global=True}” FieldName=”FirstName”
    Width=”150″/>
    <dg:Column Title=”{bx:LocalizeBinding Initials, Global=True}” FieldName=”Initials”
    Width=”100″/>
    <dg:Column Title=”{bx:LocalizeBinding Department, Global=True}” FieldName=”Department”
    Width=”250″/>
    <dg:Column Title=”{bx:LocalizeBinding Phone, Global=True}” FieldName=”Phone” Width=”150″/>
    <dg:Column Title=”{bx:LocalizeBinding Mobile, Global=True}” FieldName=”Mobile” Width=”150″/>
    <dg:Column Title=”{bx:LocalizeBinding Email, Global=True}” FieldName=”Email” Width=”250″/>
    <dg:Column Title=”{bx:LocalizeBinding State, Global=True}” FieldName=”State” Width=”100″/>
    </dg:DataGridControl.Columns>

    <dg:DataGridControl.View>
    <dg:TableView/>
    </dg:DataGridControl.View>
    </dg:DataGridControl>

    Problem is that the command does not get executed pressing the Enter key. Using another key (Space, …) does work …

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.