S
Suzanne
Hi all,
I'm having problems with datagrids and the currentcellchanged event.
My problem is this: I have a datagrid on a form, if the user changes
the text in a cell on the datagrid then tries to close the form via a
button on the toolbar (with going to another cell in the datagrid)I
want to be able to popup a messagebox to the user asking them if they
want to keep their changes.
At the momment I'm accomplishing this by a property that I set to true
in the currentcellchanged event. However if the user just tabs around
the datagrid this event is triggered even though though from the
user's point of view they haven't changed any text.
I still want the user to be able to tab around the datagrid but
perhaps not have the tab key trigger the currentcellchanged event. Is
this possible?
Another way I have thought of doing this is by trying to get the
current datagrid cell's value (using datagrid.text) and then comparing
it to the underlaying datasource's value for that cell (& if the 2 are
different then setting my property to true). However I can't find a
way of getting hold of the datagrid's datasource's value for the
current datagrid cell.
Any ideas would be most gratefully received - one more thing - my
datagrid is a custom control and I would like the above functionality
to be included within the custom control rather than the form that it
sits on.
Thanks in advance for any help
Suzanne
I'm having problems with datagrids and the currentcellchanged event.
My problem is this: I have a datagrid on a form, if the user changes
the text in a cell on the datagrid then tries to close the form via a
button on the toolbar (with going to another cell in the datagrid)I
want to be able to popup a messagebox to the user asking them if they
want to keep their changes.
At the momment I'm accomplishing this by a property that I set to true
in the currentcellchanged event. However if the user just tabs around
the datagrid this event is triggered even though though from the
user's point of view they haven't changed any text.
I still want the user to be able to tab around the datagrid but
perhaps not have the tab key trigger the currentcellchanged event. Is
this possible?
Another way I have thought of doing this is by trying to get the
current datagrid cell's value (using datagrid.text) and then comparing
it to the underlaying datasource's value for that cell (& if the 2 are
different then setting my property to true). However I can't find a
way of getting hold of the datagrid's datasource's value for the
current datagrid cell.
Any ideas would be most gratefully received - one more thing - my
datagrid is a custom control and I would like the above functionality
to be included within the custom control rather than the form that it
sits on.
Thanks in advance for any help
Suzanne