This is a migrated thread and some comments may be shown as answers.

Insert key press not detected by child control

3 Answers 61 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Craig
Top achievements
Rank 1
Craig asked on 02 Dec 2013, 10:26 AM
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)


3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 03 Dec 2013, 04:11 PM
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 >>
0
Craig
Top achievements
Rank 1
answered on 09 Dec 2013, 02:46 PM
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
0
Dimitrina
Telerik team
answered on 10 Dec 2013, 01:08 PM
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 >>
Tags
PropertyGrid
Asked by
Craig
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Craig
Top achievements
Rank 1
Share this question
or