We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How can you validate the datagrid when a menu is clicked?

Thread ID:





2148 Dec 18,2002 02:12 PM UTC Dec 19,2002 01:46 PM UTC WinForms 2
Tags: FAQ
Asked On December 18, 2002 02:12 PM UTC

I am putting data into cells that will be saved into an XML file. When you type data into a cell and leave the datagrid to go to another control, the Validate event is fired. However, if you type data into a cell and then choose a menu item on that form(eg. File-Save), the Validate event does not get fired and any data in that cell will not get written out since the cell is still in edit mode and not reflected in the dataset. Would anyone have any ideas how to detect leaving the datagrid to choose a menu item on the form? Thanks.

Replied On December 19, 2002 09:55 AM UTC

I didn't try this but it helped me in other case: private void myDataGrid_Leave(object sender, System.EventArgs e) { this.BindingContext[dataSet,"TABLENAME"].EndCurrentEdit(); this.BindingContext[dataSet,"TABLENAME"].EndCurrentEdit(); }

Replied On December 19, 2002 01:46 PM UTC

Thanks for the input but this did not work. The event does not seem to fire when going to a menu so the code will not execute. Any other ideas are welcome...


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon