This question is locked. New answers and comments are not allowed.
Hi,
I have a GridView with a CellEditTemplate like this:
As you can see, the Grid inside the data template is Collapsed. Yet, in edit mode, the textbox inside the grid receives focus and the grid itself receives the focus since the both GotFocus events are fired.
If I do the same thing inside a stackpanel for example,
as expected, the Focus events are never fired.
If I turn the inside Textbox also collapsed the behavior became correct but, for me this is not a valid workaround.
A final note : If I do the same thing in CellTemplate (the above one is in CellEditTemplate) the focus leaves the grid when hitting the column.
Can you help me here ?
Thanks,
Joao
I have a GridView with a CellEditTemplate like this:
<telerik:RadGridView Grid.Column="1" ItemsSource="{Binding Path=Items}" AutoGenerateColumns="False"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn Header="COL_BEFORE" DataMemberBinding="{Binding Path=name}" /> <telerik:GridViewDataColumn Header="COLLAPSED" Width="90"> <telerik:GridViewDataColumn.CellEditTemplate> <DataTemplate> <Grid Visibility="Collapsed" GotFocus="grid_inside_radgrid_GotFocus"> <TextBox Visibility="Collapsed" Text="ole" GotFocus="textbox_inside_grid_inside_radgrid_GotFocus" /> </Grid> </DataTemplate> </telerik:GridViewDataColumn.CellEditTemplate> </telerik:GridViewDataColumn> <telerik:GridViewDataColumn Header="COL_AFTER" DataMemberBinding="{Binding Path=name}" /> </telerik:RadGridView.Columns></telerik:RadGridView>As you can see, the Grid inside the data template is Collapsed. Yet, in edit mode, the textbox inside the grid receives focus and the grid itself receives the focus since the both GotFocus events are fired.
If I do the same thing inside a stackpanel for example,
<StackPanel> <TextBox Text="TXT_Before" /> <Grid Visibility="Collapsed" GotFocus="Grid_GotFocus"> <TextBox Text="ole" GotFocus="TextBox_GotFocus" /> </Grid> <TextBox Text="TXT_AFTER" /></StackPanel>as expected, the Focus events are never fired.
If I turn the inside Textbox also collapsed the behavior became correct but, for me this is not a valid workaround.
A final note : If I do the same thing in CellTemplate (the above one is in CellEditTemplate) the focus leaves the grid when hitting the column.
Can you help me here ?
Thanks,
Joao