Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > datagridview cellvalidating event problem(Sevier problem)
 

datagridview cellvalidating event problem(Sevier problem)

Hi,

I have a datagridview bound to a datatable. I have the cell validating event defined for this. But other events like those of form buttons are not getting raised after this event. If however, I click on the same button again, the event is getting raised. What is the solution?

Thanks in advance,

Mrinalini

Mrinalini_balaji  Monday, June 02, 2008 10:00 AM

Hi Mrinalini,

It seems that you have used a MessageBox in the CellValidating event handler to show the users some message. If so, I am afraid this is not a good practice to use a MessageBox without setting the e.Cancel in the validation event. Usually we use MessageBox to show the error and keep the focus in the validating control by setting e.Cancel to true.

However, we can use the Spy++ to monitor the Windows messages that the Button receives. You will find this is duo a WM_LBUTTONDOWN message.

Hope this helps.
Best regards.
Rong-Chun Zhang

Windows Forms General FAQs
Windows Forms Data Controls and Databinding FAQs

Rong-Chun Zhang  Friday, June 06, 2008 5:20 AM

Hi Mrinalini,

It seems that you have used a MessageBox in the CellValidating event handler to show the users some message. If so, I am afraid this is not a good practice to use a MessageBox without setting the e.Cancel in the validation event. Usually we use MessageBox to show the error and keep the focus in the validating control by setting e.Cancel to true.

However, we can use the Spy++ to monitor the Windows messages that the Button receives. You will find this is duo a WM_LBUTTONDOWN message.

Hope this helps.
Best regards.
Rong-Chun Zhang

Windows Forms General FAQs
Windows Forms Data Controls and Databinding FAQs

Rong-Chun Zhang  Friday, June 06, 2008 5:20 AM

You can use google to search for other answers

Custom Search

More Threads

• Update, delete and query form
• How to use BeginEdit() in DataGridView VB Express 2005 Beta 2
• Setting up a bound column to be a button
• Host Controls in Windows Forms DataGridView Cells
• row button click event handler
• No overload for method 'ExecuteNonQuery' takes '1' arguments
• how to Freeze column headers and first column in GridView in windows appliaction?
• Problems refreshing data/maintaining state in a grid
• How to apply a mask in a DataGridView
• datagrid view ODBC