16,019,018 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by dj dourak (Top 4 by date)
dj dourak
30-Apr-12 13:34pm
View
Just in case someone finds it useful:
I disabled the relevant events by copying the appropriate line from the form.designer.cs file and using the appropriate sign. Plus to enable, minus to disable the event.
eg this.amBox.TextChanged += new System.EventHandler(this.amBox_TextChanged);
The above enables the event.
this.amBox.TextChanged -= new System.EventHandler(this.amBox_TextChanged);
Changing the + to - disables the event.
dj dourak
30-Apr-12 13:03pm
View
Silly me!
I used the step-into feature of the debugger and finally figured out what was going on...
I have a text-changed event for most of the textboxes, which is used to extract relevant data from the database and copy them to the datagridview control (its contents change as I type on the text-boxes or whenever the text changes inside the boxes for any reason) so I guess that I'll have to circumvent triggering the event before copying the rows...
dj dourak
30-Apr-12 11:55am
View
Thanks for the answer but I don't get it! Selection is declared as int and an integer is assigned to it... (GetFirstRow returns an int)
Setting the rows as parameters would definetly do the job, but I wanted to make the code more readable since there would be about 10 parameters then. I could also create a new object containing all the rows and use it as a parameter for manageSelection.
But the question is still unanswered, why can't I access dataGridView1.Rows... etc inside the method? I have to add that the messagebox displays the correct information which means that the info is there before calling manageSelection()
dj dourak
30-Apr-12 7:48am
View
I've already done that and the Rows.Count value is indeed less inside the method. The question is why does this happen? Can I avoid it without creating new objects or deleting the method and inserting duplicate code in the appropriate event-handlers?