By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,563 Members | 1,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,563 IT Pros & Developers. It's quick & easy.

How do I know what event I am in?

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.