Can you disable double-click on the scrollbars of a gridview?

15 posts, 0 answers
  1. Richard
    Richard avatar
    7 posts
    Member since:
    Feb 2013

    Posted 09 May 2013 Link to this post

    I've got a double-click event wired up on my telerik gridview. Annoyingly for the users, if I double-click on the scrollbar area with the intention of scrolling down, the double-click event fires. Can this be disabled?
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 09 May 2013 Link to this post

    Hello,

    May I ask you to share how exactly have you subscribed for the DoubleClick event? 

    Regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Richard
    Richard avatar
    7 posts
    Member since:
    Feb 2013

    Posted 09 May 2013 Link to this post

    Sure can! I used the MouseDoubleClick event.

             <telerik:RadGridView Grid.Row="1"
                                 ShowGroupPanel="False"
                                 AutoGenerateColumns="False"
                                 ItemsSource="{Binding Products}"
                                 SelectedItem="{Binding SelectedProduct,Mode=TwoWay}"
                                 CanUserDeleteRows="False"
                                 CanUserInsertRows="False"
                                 CanUserFreezeColumns="False"
                                 CanUserReorderColumns="false"
                                 SelectionMode="Single"
                                 MouseDoubleClick="DoubleClickItem"
                                 Name="ProductList"
                                 >
  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 09 May 2013 Link to this post

    Hello,

    Generally the ScrollBar is a part of the GridView. Would you please share on what visual elements do you intend to click in order to take the proper actions?

     

    All the best,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  5. Richard
    Richard avatar
    7 posts
    Member since:
    Feb 2013

    Posted 09 May 2013 Link to this post

    Basically any cell in the grid. The double-click is passed back to my viewmodel to run a command if a row is selected. If the user selects an item then starts scrolling by clicking the scrollbar, they get erroneous double clicks that pop open dialog boxes and confuse them.
  6. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 09 May 2013 Link to this post

    Hello,

    In that case, I would suggest you to follow the approach from the Click Events WPF Demo and subscribe for the GridViewCell's double click event instead.

    Regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  7. Richard
    Richard avatar
    7 posts
    Member since:
    Feb 2013

    Posted 09 May 2013 Link to this post

    Hi again.

    I'm looking at that demo in the "Demos - Rad Controls for WPF" tool I installed during the setup of the Telerik tools but I can't find any reference to that event. It looks like maybe I can't see all the files in the demo (I see ClassNameConverter.cs, ConfigurationPanelBehavior.cs, Example.xaml and Example.xaml.cs).

    Could you post an example XAML of how to attach this event please?

    Thanks
  8. Richard
    Richard avatar
    7 posts
    Member since:
    Feb 2013

    Posted 09 May 2013 Link to this post

    I fixed it by adding this - a bit of a fudge but it works:

                <telerik:RadGridView.RowStyle>
                    <Style>
                        <EventSetter Event="telerik:RadGridView.MouseDoubleClick" Handler="DoubleClickItem"/>
                    </Style>
                </telerik:RadGridView.RowStyle>

  9. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 09 May 2013 Link to this post

    Hello,

    Just search for the "Click Event" demo. The code to attach this event would be:

    this.grid.AddHandler(GridViewCellBase.CellDoubleClickEvent, new EventHandler<RadRoutedEventArgs>(OnCellDoubleClick), true);


    Kind regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  10. Sriraksha
    Sriraksha avatar
    8 posts
    Member since:
    Apr 2015

    Posted 08 Apr 2015 Link to this post

    hi...

     i wantu handle doubleclick whenever the form is hidden. please help

  11. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 08 Apr 2015 Link to this post

    Hello,

    I am not sure how to understand your question. How do you double click on a hidden form? This thread is regarding disabling double-click on the scrollbars of RadGridView, do you have a different question? Would you please be a bit more specific? 

    Regards,
    Dimitrina
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  12. Sriraksha
    Sriraksha avatar
    8 posts
    Member since:
    Apr 2015

    Posted 08 Apr 2015 Link to this post

    when I run my program initially I ll be having the gridview as shown in grid.PNG.... when I double click on the cell of gridview I ll get the form in right as shown in gridwithform.PNG . so  what m telling is when this form is opened, double click should not work..
  13. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 09 Apr 2015 Link to this post

    Hi,

    Upon double click on any row, then RadGridView's RowActivated event will be raised. You can subscribe for it and try handling the action.
    In case, you need something different and as I am not sure how you have currently implemented your specific logic on double click, would it be possible for you to illustrate the specific case in a demo project with your exact setup? You can send it to us via a new support thread. You can also take a look at this blog post for a reference on how to isolate an issue.  

    Regards,
    Dimitrina
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  14. Sriraksha
    Sriraksha avatar
    8 posts
    Member since:
    Apr 2015

    Posted 09 Apr 2015 in reply to Dimitrina Link to this post

    hello.... sorry...

    please explain in kendo ui

  15. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 09 Apr 2015 Link to this post

    Hello,

    You have posted your question under category RadGridView for WPF. In case it is related to Kendo UI, I would suggest you checking the Kendo UI forums instead.

    Regards,
    Dimitrina
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top