Results 1 to 2 of 2

Thread: C# and Datagrid

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Location
    Vienna
    Posts
    24

    C# and Datagrid

    Hi!

    I am new in C#.
    I am using a datagrid. Is it possible to find out in which cell I have clicked. And is it possible to highlight it? Or change the content of the cell.

    Does anybody know a good tutorial for C# ?


    Thanks for help !!!

  2. #2
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: C# and Datagrid

    Originally posted by AngryT
    Hi!

    I am new in C#.
    I am using a datagrid. Is it possible to find out in which cell I have clicked. And is it possible to highlight it? Or change the content of the cell.

    Does anybody know a good tutorial for C# ?


    Thanks for help !!!
    Yes you will have to use HitTest method.

    Code:
     
    Point pt = new Point(e.X, e.Y);
    DataGrid.HitTestInfo hti = dgContact.HitTest(pt); 
     
    MessageBox.Show (hti.Column.ToString() + " " + hti.Row.ToString());
    As for Tutorial check this, http://www.c-sharpcorner.com/Tutorials.asp
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

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