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

No click event for a control inside RowDetailsTemplate

1 Answer 71 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Stas
Top achievements
Rank 1
Stas asked on 07 Sep 2011, 11:55 AM
There's a problem. If I have RowDetailTemplate and say, HyperlinkButton inside, I need to click twice for  click event to be fired.
It seems the 1st click activates row detail panel itself, and just then HyperlinkButton can receive the event.
The code is  pretty simple:
        <telerik:RadGridView SelectionMode="Single" SelectionUnit="FullRow"
                             CanUserFreezeColumns="False" EditTriggers="None" IsSynchronizedWithCurrentItem="False" ShowGroupPanel="False" AutoGenerateColumns="False" RowIndicatorVisibility="Collapsed" ScrollViewer.HorizontalScrollBarVisibility="Auto" RowStyle="{StaticResource GridViewRowStyle}" IsFilteringAllowed="False">
            <telerik:RadGridView.Columns>
                <telerik:GridViewToggleRowDetailsColumn Width="20" />
...
            </telerik:RadGridView.Columns>
            <telerik:RadGridView.RowDetailsTemplate>
                <DataTemplate>
 
                            <HyperlinkButton x:Name="hl" Content="Link" Margin="0 2 0 0" HorizontalAlignment="Left"
                                                 Visibility="{Binding Status, Converter={StaticResource enumConverter}, ConverterParameter=Active}"
                                                 Style="{StaticResource HyperlinkButtonNoBorderStyle}"
                                                 Click="OnClick"
                                                  />
 
                </DataTemplate>
            </telerik:RadGridView.RowDetailsTemplate>
     </telerik:RadGridView>

Is there any workaround for the issue?

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 08 Sep 2011, 02:48 PM
Hi Stas,

The reason would be a lack of focus as opening the inner grid, the focus does not goes to it. What you may do is to handle the Loaded event and call Focus() method:

Copy Code

private void ordersGrid_Loaded(object sender, RoutedEventArgs e)
        {
            (sender as RadGridView).Focus();
        }

I hope that this is what you are looking for.

Best wishes,
Didie
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
GridView
Asked by
Stas
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or