RadGridView DoubleClick fires on the header, the scrollbar, and on non-rows

2 posts, 0 answers
  1. Craig
    Craig avatar
    3 posts
    Member since:
    Dec 2012

    Posted 11 Dec 2012 Link to this post

    I wish for my edit window (RentalTicket) to only open when I double click on a valid row.  I want nothing to happen if the headers are double clicked, or if the scrollbar is double clicked.
    Also, when I click on blank space in my RadGridView, the selected row is still selected.  I think that the selected row should de-select if I click on a non row in the RadView Grid.

    My RadGridView:
    </telerik:RadGridView>
            <telerik:RadGridView AutoGenerateColumns="False" Margin="12,0,12,12" Name="radGridViewNeedsShipping" SelectionMode="Extended" ShowGroupPanel="False" Height="190" VerticalAlignment="Bottom" MouseDoubleClick="rgvOpenTicket" >
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn Header="PO Number" IsReadOnly="True" UniqueName="SerialNumber" CellStyleSelector="{StaticResource transactionStyleSelector}"/>
                    <telerik:GridViewDataColumn Header="Customer" IsReadOnly="True" UniqueName="Customer.EntityName" />
                    <telerik:GridViewDataColumn Header="Ship By Date" IsReadOnly="True" UniqueName="TransactionDate" DataFormatString="{}{0:MM/dd/yyyy}"/>
                    <telerik:GridViewDataColumn Header="Type" IsReadOnly="True" DataMemberBinding="{Binding Path=TransactionTypeId, Converter={StaticResource transactionTypeConverter}}" />
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>

    and this is my doubleClicked function:
    private void rgvOpenTicket(object sender, MouseButtonEventArgs e)       
            {
                RentalTicket rt = new RentalTicket(((Transaction)((Telerik.Windows.Controls.RadGridView)sender).SelectedItem));
                rt.Closing += new System.ComponentModel.CancelEventHandler(dispatcherTimer_Tick);
                rt.Show();
            }
  2. Nick
    Admin
    Nick avatar
    593 posts

    Posted 14 Dec 2012 Link to this post

    Hello Craig,

    You can easily achieve the behavior you are looking for. 
    I wish for my edit window (RentalTicket) to only open when I double click on a valid row.  I want nothing to happen if the headers are double clicked, or if the scrollbar is double clicked.
    You can subscribe to the RowActivated event and open the edit window there. 

    Also, when I click on blank space in my RadGridView, the selected row is still selected.  I think that the selected row should de-select if I click on a non row in the RadView Grid.
    You can handle the row's MouseDown events and deselect the row if no cell was clicked.

    Hope this helps! 

    Regards,
    Nik
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top