473,803 Members | 4,591 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Where is HitTestInfo?

I've read on the forums of other people having problems with
HitTestInfo not appearing. I've read these but they didn't help:

http://groups.google.com/group/micro...6428decee1637e

http://groups.google.com/group/micro...d9c9894057861a

System.Windows. Forms.DataGrid doesn't have it either. Any ideas?

Thanks,
Brett

Dec 9 '05
15 2379
Brett,

When you open project in VSS it should create two subfolders - 'bin' and
'obj'. Both folders have subfolders in their own - Debug and Release.

Look at
[project folder]\obj\Debug
and
[project folder]obj\Release

there have to be files with extension 'projdata', delete them

Or, easier, delete the whole 'obj' folder all together; VS will create it
again
--

Stoitcho Goutsev (100) [C# MVP]

"Brett Romero" <ac*****@cygen. com> wrote in message
news:11******** *************@g 14g2000cwa.goog legroups.com...
Sorry, didn't mean to offend. Guess I didn't understand the problem
enough and was posting gibberish. Not trying to claim I know more than
you. I appreciate all of your help greatly.

I did also get it to work by just typing HitTestInfo. All of the weird
compile errors went away. Not sure why. I also had to manually type
hit.Row or hit.Column. No intellisense. It is all working now.

I didn't find a *.projdata file. I'm using VSS with VS.NET so not sure
if that changes things. I do have these files:
*.csproj
*.scc
*.sln
*.csproj.user
*.suo
*.csproj.vspscc

That tip on deleting the file and getting intellisense back would be
great. Any idea why our setups are different in reference to
*.projdata?

Here's the code that will get the coordinates of a cell in a datagrid.
Also highlights the clicked row and dehighlights when a new row is
clicked. One thing, how do I get the value in say column 2 when all I
have are coordinates? I can't use CurrentCell or EditCell. I'm using
the right mouse click so there is no EditCell. CurrentCell gives a
cell from left clicking. I just need something I can feed in my row
index, traverse to a column and get that value.

private int lastRowSelected = 0;
private void Participant_Mou seDown(object sender, MouseEventArgs e)
{
//Participant is the datagrid name
Participant.UnS elect(lastRowSe lected);

Point pt = new Point(e.X, e.Y);
System.Windows. Forms.DataGrid. HitTestInfo hit =
Participant.Hit Test(pt);
if (e.Button == MouseButtons.Ri ght)
{
if(hit.Type == DataGrid.HitTes tType.Cell)
{
Participant.Sel ect(hit.Row);
lastRowSelected = hit.Row;
}
}
}

Thanks agian,
Brett

Dec 9 '05 #11
Ok, I tried that but HitTestInfo still doesn't show up. Deleted both
the bin and obj folders then rebuilt.

Any ideas on getting a datagrid cell value using coordinates?

Thanks,
Brett

Dec 9 '05 #12
Other than HitTest method? ...Hm I can't think of anything. DataGrid.HitTes t
is meant to be used for this.

Sorry to hear deleting those files/folders didn't work for you, they
certainly did work for me.

--

Stoitcho Goutsev (100) [C# MVP]

"Brett Romero" <ac*****@cygen. com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
Ok, I tried that but HitTestInfo still doesn't show up. Deleted both
the bin and obj folders then rebuilt.

Any ideas on getting a datagrid cell value using coordinates?

Thanks,
Brett

Dec 9 '05 #13
Here's a revised "if" statement that does get the cell value:

if(hit.Type == DataGrid.HitTes tType.Cell)
{
Participant.Sel ect(hit.Row);
DataGridCell dgc = Participant.Cur rentCell;
dgc.RowNumber = hit.Row;
dgc.ColumnNumbe r = 2;
Participant.Cur rentCell = dgc;
personIDToFile = Participant[dgc].ToString();
//save current cell for dehighlighting on next selection
lastRowSelected = hit.Row;
}

Another question on this, how do I handle some one highlighting a cell,
holding down shift and selecting three rows. I'd like to get the value
from column three for each of those rows (as I do above). My current
method will always get the value from the cell where the right mouse
click occurred. Any ideas?

Thanks,
Brett

Dec 9 '05 #14
Brett,

I can see that similar questions has been asked many times in the news
groups. I believe that you can find the answer of your question in google.
For example look at this thread

http://groups.google.ca/group/micros...c9abf5c464fcaf
--

Stoitcho Goutsev (100) [C# MVP]

"Brett Romero" <ac*****@cygen. com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
Here's a revised "if" statement that does get the cell value:

if(hit.Type == DataGrid.HitTes tType.Cell)
{
Participant.Sel ect(hit.Row);
DataGridCell dgc = Participant.Cur rentCell;
dgc.RowNumber = hit.Row;
dgc.ColumnNumbe r = 2;
Participant.Cur rentCell = dgc;
personIDToFile = Participant[dgc].ToString();
//save current cell for dehighlighting on next selection
lastRowSelected = hit.Row;
}

Another question on this, how do I handle some one highlighting a cell,
holding down shift and selecting three rows. I'd like to get the value
from column three for each of those rows (as I do above). My current
method will always get the value from the cell where the right mouse
click occurred. Any ideas?

Thanks,
Brett

Dec 12 '05 #15

use the namespace:

using System.Componen tModel.Design;
*** Sent via Developersdex http://www.developersdex.com ***
Nov 16 '06 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

47
3651
by: Andrey Tatarinov | last post by:
Hi. It would be great to be able to reverse usage/definition parts in haskell-way with "where" keyword. Since Python 3 would miss lambda, that would be extremly useful for creating readable sources. Usage could be something like: >>> res = where: >>> def f(x):
3
22007
by: A.V.C. | last post by:
Hello, I found members of this group very helpful for my last queries. Have one problem with CASE. I can use the column name alias in Order By Clause but unable to use it in WHERE CLAUSE. PLS TELL ME IF IT IS POSSIBLE TO USE IT IN WHERE CLAUSE AND SOME ALTERNATIVE. QUERY: SELECT
3
2288
by: Xiangliang Meng | last post by:
Hi, all. In 1998, I graduated from Computer Science Dept. in a university in China. Since then, I've been using C Language for almost 6 years. Although I'm using C++ in my current job, I'm also interested in understanding C more and deeper at the same time. In the past half year, I decide to improve myself on C, read some books on C and digest some posts on comp.lang.c and comp.lang.c++. Now, I feel I have a better insight on C than...
1
1289
by: GG | last post by:
Is there a class similar to DataGrid.HitTestInfo for Keyboard moving? Need to get the coordinates of the grid when the user is using the shift key and arrows Thanks *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
2
1990
by: Tom P | last post by:
I'm trying to use DataGrid.HitTestInfo in my OnMouseDown event but firstly I cannot see it in Intellisense, secondly when I try to use it I get strange 'COMPILE' errors when building the app I'll be happy to provide more details if anyone has any answers I've read some forums and someone else had similar problem but there were no solutions provided Can anyone from MS comment on this?
3
1465
by: John Smith | last post by:
Hey folks, Does anyone know if it's possible for me to determine on a checkbox's checkedchanged event whether the actual box was clicked or if it's text was clicked? I know with DataGrids you can do that whole HitTestInfo stuff and determine if the rowheader was clicked or a cell...Can you do something similar with checkbox? And if so, how?
7
3046
by: Britney | last post by:
Original code: this.oleDbSelectCommand1.CommandText = "SELECT TOP 100 user_id, password, nick_name, sex, age, has_picture, city, state, " + "country FROM dbo.users WHERE (has_picture = ?) AND (sex = ?) ORDER BY age " this.oleDbSelectCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("has_picture", System.Data.OleDb.OleDbType.Boolean, 1, "has_picture")); this.oleDbSelectCommand1.Parameters.Add(new...
1
1183
by: asprabahar | last post by:
Hi I have a Different Issue the Class DataGrid.HitTestInfo is missing . The issue is when i type DataGrid and then when i type (.) and the HitTestInfo is not diaplaying ,but the say way when i copy from some were and past it in the code it works .. What may be the Issue? Regards Prabakar
0
986
by: Beagley | last post by:
I'm trying to give a context menu to my user when they right click on a particular row in my datagrid. I created two functions that pass back the indicies for the row and column. The following code is located in the Mouse_Clicked event point for the datagrid itself. When I right click the first time everything works perfetly, but the next time I right click the context menu comes up but nothing else gets updated. If I left click on the...
0
9564
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10548
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10295
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7604
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6842
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5500
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.