Insert key press not detected by child control

4 posts, 0 answers
  1. Craig
    Craig avatar
    112 posts
    Member since:
    Nov 2011

    Posted 02 Dec 2013 Link to this post

    Hi
    I have a GridView hosted within a PropertyGrid.PropertyDefinition.EditorTemplate. If the grid is empty, when the Insert key is pressed a new row is not added to the grid. If the grid has data a new row is added to the grid.

    When the grid is empty, before I press the Insert key, I click a column header in the grid (I can see the sort glyph change in the column header). If I click the filter button so that the filter dialog is displayed and then press Insert, a new row is added to the grid.

    If I take it out of the PropertyGrid and display it independently, a new row does appear on Insert key press if the grid is empty or not.

    Something doesn't seem right to me.

    Regards,
    Craig

    RadControls for WPF Q3 2013 (2013.3.1016.40)


  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 03 Dec 2013 Link to this post

    Hello,

    There should be an issue that RadGridView does not get the focus when it is placed as an EditorTemplate and there are no items in it.
    My suggestion to workaround this would be to set NewRowPosition="Top" for RadGridView. That way you will be able to add a new item.

    Regards,
    Didie
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Craig
    Craig avatar
    112 posts
    Member since:
    Nov 2011

    Posted 09 Dec 2013 Link to this post

    Hi Didie,
    The result of using the Insert key if NewRowPostion="Top" is used is different. The row inserted either by Insert key or by clicking the new row bar does not become the selected item when a cell in that new row is clicked. This prevents me from using the same binding target for new and existing rows.

    I've attached an updated sample to help explain in the support ticket (sorry I got you mixed up with Ady in the ticket ).

    Craig
  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 10 Dec 2013 Link to this post

    Hi Craig,

    To achieve your goal, you could modify your code similar to:

    <telerik:RadDropDownButton.DropDownContent>
        <v:ChildView DataContext="{Binding Source={StaticResource MainWindowViewModelDataSource}}"
                     DpCode="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:GridViewRow}}, Path=DataContext.Dept_Code, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
    </telerik:RadDropDownButton.DropDownContent>


    As a side note I should mention that when the UI Virtualization is enabled, we do not recommend you to rely on the visual elements and the RelativeSource Binding. 

    Regards,
    Didie
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top