Results 1 to 3 of 3

Thread: How to get DataGrid Cell's top&Left

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Posts
    252

    How to get DataGrid Cell's top&Left

    Hi all gurus,
    I am back with my problem.

    I want to know datagrid's currentCell's top & Left Location.
    How to get it.


    Thank you.

  2. #2
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Dublin (Ireland)
    Posts
    304
    this is an example of using ther HitTestInfo,

    however as you can see you can access the x,y co-ordinates which should give you the inofrmation you need

    Public Sub DataGrid1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs)
    Console.WriteLine()
    Dim myHitTest As DataGrid.HitTestInfo
    ' Use the DataGrid control's HitTest method with the x and y properties.
    myHitTest = DataGrid1.HitTest(e.X, e.Y)
    Console.WriteLine("Column " & myHitTest.Column)
    Console.WriteLine("Row " & myHitTest.Row)
    Console.WriteLine("Type " & myHitTest.Type)
    Console.WriteLine("ToString " & myHitTest.ToString)
    Console.WriteLine("Format " & myHitTest.Type.ToString)
    End Sub

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Posts
    252

    Got it

    I am working on VB.NET,
    I tried different way and finally I got solution.

    Thank you for your help.

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