Results 1 to 7 of 7

Thread: catch "double click" in datagrid column header cell

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    catch "double click" in datagrid column header cell

    Dim pt As Point
    Dim hti As DataGrid.HitTestInfo

    pt = DataGrid1.PointToClient(Cursor.Position)
    hti = DataGrid1.HitTest(pt)
    If (hti.Type = DataGrid.HitTestType.ColumnHeader) Then
    Messagebox.Show("double clicked")
    End If

    It says hti.type is 'none'

    This code was available on syncfusion.com. I am not able to find out why it says none.

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    I put the code in the DoubleClick event of datagrid and it works ok. Check it again.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    no luck I have put the code in doubleclick event of the datagrid

    could you post your code please?

    thanks
    nath

  4. #4
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    That's your code I used:
    VB Code:
    1. Private Sub DataGrid1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.DoubleClick
    2.         Dim pt As Point
    3.         Dim hti As DataGrid.HitTestInfo
    4.         pt = DataGrid1.PointToClient(Cursor.Position)
    5.         hti = DataGrid1.HitTest(pt)
    6.         If (hti.Type = DataGrid.HitTestType.ColumnHeader) Then
    7.             MessageBox.Show("double clicked")
    8.         End If
    9.     End Sub
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    thanks ...it works

    it works

    nath

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    does same code work in asp.net page also

    I hope in asmx (web page) same code works.

    nath

  7. #7
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    No, it won't.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width