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

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

14 Answers 590 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 09 May 2013, 10:04 AM
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?

14 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 09 May 2013, 10:13 AM
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.

0
Richard
Top achievements
Rank 1
answered on 09 May 2013, 10:18 AM
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"
                             >
0
Dimitrina
Telerik team
answered on 09 May 2013, 10:21 AM
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.

0
Richard
Top achievements
Rank 1
answered on 09 May 2013, 10:22 AM
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.
0
Dimitrina
Telerik team
answered on 09 May 2013, 10:36 AM
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.

0
Richard
Top achievements
Rank 1
answered on 09 May 2013, 11:05 AM
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
0
Richard
Top achievements
Rank 1
answered on 09 May 2013, 11:11 AM
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>

0
Dimitrina
Telerik team
answered on 09 May 2013, 11:26 AM
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.

0
Sriraksha
Top achievements
Rank 1
answered on 08 Apr 2015, 06:19 AM

hi...

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

0
Dimitrina
Telerik team
answered on 08 Apr 2015, 08:26 AM
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.

 
0
Sriraksha
Top achievements
Rank 1
answered on 08 Apr 2015, 09:16 AM
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..
0
Dimitrina
Telerik team
answered on 09 Apr 2015, 07:35 AM
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.

 
0
Sriraksha
Top achievements
Rank 1
answered on 09 Apr 2015, 08:40 AM

hello.... sorry...

please explain in kendo ui

0
Dimitrina
Telerik team
answered on 09 Apr 2015, 08:43 AM
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.

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