473,406 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How do I know what event I am in?

Hi,

In my .Net 1.1 C# windows form, I have a DataGrid DG1.
The DG1 have a column dc1 which format is TextBox.
And I want to check the whave value I have typed in.
My question is the new value doesn't really go into the DataGrid1's dc1
until some event occurs (e.g., KeyPress, KeyDown, ...)
but I don't know what the event is.
Is it possible to observe what event I'm in?
Thanks for help.
Jason
Jul 13 '07 #1
3 1515
On 13 Jul, 10:38, "Jason Huang" <JasonHuang8...@hotmail.comwrote:
Hi,

In my .Net 1.1 C# windows form, I have a DataGrid DG1.
The DG1 have a column dc1 which format is TextBox.
And I want to check the whave value I have typed in.
My question is the new value doesn't really go into the DataGrid1's dc1
until some event occurs (e.g., KeyPress, KeyDown, ...)
but I don't know what the event is.
Is it possible to observe what event I'm in?
Thanks for help.

Jason
This is quite a common problem. For example people want to know if a
user changed a control, or whether it was changed programmatically.
Listbox one changes the value in listbox two, was it the user
selecting a new value or the change in listbox one?

The answer generally is to use flags. Set a bool to true when a
specific event fires and refer to that flag when you need to know the
current state. That would work for you too I think.

Jul 13 '07 #2
First you need to decide what kind of events you want to respond to.
Keypress, keydown, keyup are all client-side events that occur in the browser
and need to be handled with client script. TextChanged, on the other hand, is
s server side event and is handled on a postback (or with Remote Scripting
"AJAX", a callback).
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder(BETA): http://www.blogmetafinder.com

"Jason Huang" wrote:
Hi,

In my .Net 1.1 C# windows form, I have a DataGrid DG1.
The DG1 have a column dc1 which format is TextBox.
And I want to check the whave value I have typed in.
My question is the new value doesn't really go into the DataGrid1's dc1
until some event occurs (e.g., KeyPress, KeyDown, ...)
but I don't know what the event is.
Is it possible to observe what event I'm in?
Thanks for help.
Jason
Jul 13 '07 #3
Sorry about thait, my mind was "in the web" and not enough coffee yet this
morning! At any rate, you can attach handlers for all the events in your
Windows Form and decide which ones you want to write code for.

-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder(BETA): http://www.blogmetafinder.com

"Jason Huang" wrote:
Hi,

In my .Net 1.1 C# windows form, I have a DataGrid DG1.
The DG1 have a column dc1 which format is TextBox.
And I want to check the whave value I have typed in.
My question is the new value doesn't really go into the DataGrid1's dc1
until some event occurs (e.g., KeyPress, KeyDown, ...)
but I don't know what the event is.
Is it possible to observe what event I'm in?
Thanks for help.
Jason
Jul 13 '07 #4

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

Similar topics

1
by: Serge Shimanovsky | last post by:
Hi, I have a situation where I need to clear the event sinks from an event. But let's say I don't know which methods (by name, I mean) signed up for that event. I do have a control with...
1
by: SevDer | last post by:
Hi, I would like to know whether specific event is being fired or not before this event is handled. To be more clear I have the ASP.NET page and a few button etc. events declared in it. At...
2
by: Erick | last post by:
Hi, Is there any way that I can know the object that does fires or does postback to the page on the Page_Load event. I tried to use the sender object that is defined as parameter into this...
2
by: jorge | last post by:
Hello I have the following situation: (everything is dynamic (controls.add)) 1. Button.Init { WasButtonClickFired = true } 2. TextBox.TextChanged { WasButtonClickFired?
6
by: JohnR | last post by:
I'm running into a 'timing' or 'race' condition on my form. All textbox controls are bound to a datasource, but certain other controls (like labels) need to be updated when you move to a...
6
by: artev | last post by:
In a select , if I want use the same function on the click and onchange events; how I can write a code inner the function that can know wich events have activate itself?
3
by: cty0000 | last post by:
Please anybody help me... I have some serious problem.. I'm doing to keep equpiment list(string).. In my code, there are 3 page which are having 4 equpiment ID (user control.) like this...
3
by: Smithers | last post by:
In consideration of the brief sample code at the following link... http://msdn2.microsoft.com/en-us/library/system.componentmodel.canceleventargs.cancel.aspx .... when we set e.Cancel = true,...
5
by: sstory | last post by:
I have a class in vb.net that Inherits Generic.List(Of myclass) I want to have totals in this class that are static...i.e. not recalculated every time. They should be calculated once and never...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.