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

Cell double click event issue

4 Answers 1372 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dev
Top achievements
Rank 1
Veteran
Dev asked on 23 Jul 2019, 12:26 PM

Hello,

Cell double click event is not firing In the rad grid view when the grid cell property is Readonly = False(Cell edit). 

We need a option that during cell edit it should trigger the cell_double click event.

Attached demo project for your reference. Please suggest & do the needful.

Demo project   & Demo video

4 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 23 Jul 2019, 12:59 PM
Hello, Rick,  

The CellDoubleClick event is expected to be fired when you double click a cell. However, have in mind that the first click will select a cell and the second click will activate the editor for it. Hence, the activated editor will handle the mouse input and the CellDoubleClick even won't be fired. This is normal behavior.

One possible solution is to set the RadGridView.BeginEditMode property to RadGridViewBeginEditMode.BeginEditProgrammatically and call the BeginEdit method each time you want to enter edit mode, e.g. in the CellDoubleClick event handler:

Public Sub New()
    InitializeComponent()
    AddHandler Me.RadGridView1.CellDoubleClick, AddressOf radGridView1_CellDoubleClick
 
    Me.RadGridView1.BeginEditMode = Telerik.WinControls.RadGridViewBeginEditMode.BeginEditProgrammatically
End Sub
 
Private Sub radGridView1_CellDoubleClick(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.GridViewCellEventArgs)
    MessageBox.Show("hi")
    Me.RadGridView1.BeginEdit()
End Sub

An alternative approach is to handle the editor's mouse input. Subscribe to the CellEditorInitialzied event when you have access to the activated editor. Then, considering what editor is being activated handle the editor's event that you need. The following help article demonstrates how to handle keyboard event for the editor. A similar approach may be followed for the mouse events: https://docs.telerik.com/devtools/winforms/controls/gridview/editors/handling-editors'-events

Note that most of the forum threads are reviewed by Telerik representatives and sometimes we address the questions asked by our customers in the forums as well. However, a post in the forum doesn't guarantee you a response from the Telerik support team. Moreover, threads are handled according to license and time of posting, so if it is an urgent problem, we suggest you use a support ticket, which would be handled before a forum thread. Thank you for your understanding.
 
I hope this information helps.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Dev
Top achievements
Rank 1
Veteran
answered on 26 Jul 2019, 08:53 AM

Hi,

Thanks for your inputs, we tried the method which you shared but it was not a good solution for our application.
The cell DoubleClick event if firing on by using the Datagridview(windows default control) but it is not firing in the Radgrid view.
The possible condition which you suggested is that RadGridViewBeginEditMode.BeginEditProgrammatically is for the cell has to be changed as normal mode. But in our application, the cell must have an edit mode but if I change it to normal mode I'm unable edit anything in that particular cell. Mentioned the below video link for your reference. 

Can you please suggest a method to edit to have a cell double click in celledit mode?

Video link : https://suganya-gmail.tinytake.com/tt/MzY2NjU3OF8xMTEyMTIzMg

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 29 Jul 2019, 07:25 AM
Hello, Rick,   

Note that the MS DataGridView and the Telerik RadGridView have different internal implementation and mouse/keyboard handling. In RadGridView, the editor is being activated when handling the left mouse down button in a selected cell. That is why in a normal situation, the editor is already activated before processing the second click which would fire the CellDoubleClick event.

As it was demonstrated in my previous reply, you may have the CellDoubleClick event fired and the editor activated in RadGridView by enabling the RadGridViewBeginEditMode.BeginEditProgrammatically and calling the BeginEdit method in the CellDoubleClick event handler. You may call the BeginEdit method before showing the message box and then proceed with further mouse handling. 

Off topic, have in mind that RadGridView manages user mouse and keyboard input over its rows by GridRowBehavior. Depending on the row type, RadGridView introduces different behaviors. If you need to customize the default behavior, you can create your own as it is demonstrate din the following help article: https://docs.telerik.com/devtools/winforms/controls/gridview/rows/row-behaviors

Using the sample code snippet from my previous reply, I have prepared a sample project for your reference. 

I hope this information helps.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Dev
Top achievements
Rank 1
Veteran
answered on 17 Aug 2019, 07:19 AM

Hello,

Thanks for your inputs, we have solved it ourselves & code attached for your reference.

Code:

 Private Sub rdgvOItem_CellEditorInitialized(sender As Object, e As GridViewCellEventArgs) Handles rdgvOItem.CellEditorInitialized
        If Not processingMask Then
            Dim tbMaskEditor As RadMaskedEditBoxEditor = TryCast(Me.rdgvOItem.ActiveEditor, RadMaskedEditBoxEditor)
            If Not tbMaskEditor Is Nothing Then
                processingMask = True
                Dim tbMaskElement As RadMaskedEditBoxEditorElement = CType(tbMaskEditor.EditorElement, RadMaskedEditBoxEditorElement)
                AddHandler tbMaskElement.TextBoxItem.HostedControl.MouseDoubleClick, AddressOf TextBoxItem_MouseDoubleClick
            End If
        End If
    End Sub

Tags
GridView
Asked by
Dev
Top achievements
Rank 1
Veteran
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Dev
Top achievements
Rank 1
Veteran
Share this question
or