468,484 Members | 2,095 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,484 developers. It's quick & easy.

Please Help! - How can I tell if the blank DataGrid row is "editing"

I need to be able to tell if the blank row of a DataGrid has been edited or

In a DataGrid, you may notice that if you click on the asterisk row, the
asterisk will change to a triangle, but no "new" blank asterisked row will be
added to the bottom *until* you type some data. How can I tell if you have
begun to type data into this row or not?

Here is the reason I need this. I need to call
CurrencyManager.EndCurrentEdit() on a row before I programmatically update/add
it to the datastore. This is so EndCurrentEdit() can auto-check for columns
that have their AllowDBNull set to false. The problem is that EndCurrentEdit()
checks for this condition and complains, regardless of whether somebody has
entered data into the blank row or not.

The Microsoft code does not do this. E.g. if you are on the "last" row of the
datagrid, but have not entered data, and you click somewhere else on the form,
no error message appears (but it will complain if you have entered data).

I stepped through the Microsoft assembly code to find out why this is, and
discovered (surprise surprise) that the Microsoft code has some private
esoteric function calls that somehow check the state of this row before
deciding to call EndCurrentEdit(). That is, if you are on the blank row, but
have not entered any data, the Microsoft code does NOT call EndCurrentEdit().
BUT, if you have entered some data in the blank row, the Microsoft code DOES
call EndCurrentEdit().

I want to check for this condition too, but I can't figure out how they are
doing it. Does anyone know what test I need to make, or if it is even possible?

Please, please someone let me know, this is driving me crazy!

Nov 15 '05 #1
0 1074

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Sarah Michael | last post: by
2 posts views Thread by Eric | last post: by
7 posts views Thread by Eddy Soeparmin | last post: by
2 posts views Thread by I am Sam | last post: by
2 posts views Thread by Brad Shook | last post: by
1 post views Thread by princessfrost | last post: by
2 posts views Thread by gieforce | last post: by
reply views Thread by theflame83 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.