PC Review


Reply
Thread Tools Rate Thread

dataGrid[ hti.Row, hti.Column ] = ! (bool) dataGrid[ hti.Row, hti.Column ]

 
 
Jason Huang
Guest
Posts: n/a
 
      21st Dec 2006
Hi,

In the code:

DataGrid.HitTestInfo hti = dataGrid.HitTest( e.X, e.Y );
dataGrid[ hti.Row, hti.Column ] = ! (bool) dataGrid[ hti.Row, hti.Column ];

Would someone tell me what the line doing:
DataGrid.HitTestInfo hti = dataGrid.HitTest( e.X, e.Y );

Thanks.

Jason


 
Reply With Quote
 
 
 
 
=?Utf-8?B?RHJfRnJhbno=?=
Guest
Posts: n/a
 
      21st Dec 2006
Hello,
This method would be use in a Click Event. It gives information about the
System.Windows.Forms.DataGrid control at a specified point on the screen. e
is the point you have clicked. DataGridHitTest give you the the Clicked
Cell.

Example:

private void dataGrid1_MouseUp(System.Windows.Forms.MouseEventArgs e)
{
DataGrid.HitTestInfo hti = this.HitTest(new Point(e.X, e.Y));
switch(hti.Type)
{
case DataGrid.HitTestType.RowHeader:
//RowHeader was clicked
break;

case DataGrid.HitTestType.ColumnHeader:
//ColumnHeader was clicked
break;

case DataGrid.HitTestType.Cell:
//a Cell was clicked
break;
}
}

http://msdn2.microsoft.com/en-us/lib...d.hittest.aspx
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid bool column winforms... Sergiu Cojocaru Microsoft C# .NET 0 29th Nov 2004 12:44 PM
datagrid bool column bound to two columns nate axtell Microsoft VB .NET 1 2nd Nov 2004 08:55 PM
Datagrid Bool Column not working WStoreyII Microsoft VB .NET 4 25th Mar 2004 01:27 AM
Datagrid bool column =?Utf-8?B?QWJoaWplZXQ=?= Microsoft C# .NET 0 1st Mar 2004 02:06 PM
Datagrid BOOL Column BRJving Microsoft VB .NET 2 16th Oct 2003 07:40 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:02 AM.