Windows Develop Bookmark and Share   
 index > Windows Forms General > [VB.NET] Datagridview and on error e.cancel=true seems not work always
 

[VB.NET] Datagridview and on error e.cancel=true seems not work always

Good day to everyone, I have a trouble from few days that I can't still solve so I hope someone can give me a suggestion on how to let it work properly.
I have a datatable filled from a database and it's binded to a datagridview, now on this datatable I have a field where I never want to let a user let it NULL. So I try to catch the event inside the dataerror of my datagridview as saw on many post, and seems working, but if I do this chain of operation the control get crazy:

1: Select a cell not empty
2: enter in editmode inside it and erase all it's content
3: then dataerror pop and give me error and errorprovider set with error too
4: if I just press mouse button in another row of datagridview, or inside some textbox bounded inside my form then seems e.cancel stop working at all ......

What is the currect sequence for catch an error like this and never let the user do anything untill solve this problem ?? Thanks in advance to anyone will help me understand it.
Good Day.
Plaguebreath  Saturday, September 05, 2009 8:46 AM

Hi,

Base on my understanding, you want to let user tab out the control when there is an error.

Please refer to the following article:

Why can't I Tab out of my Control when using data binding?

http://windowsclient.net/blogs/faqs/archive/2006/07/12/why-can-t-i-tab-out-of-my-control-when-using-data-binding.aspx

Why can't I close my Form when using Data Binding?

http://windowsclient.net/blogs/faqs/archive/2006/07/12/why-can-t-i-close-my-form-when-using-data-binding.aspx

Best regards,

Ling Wang


Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Saturday, September 12, 2009 8:37 AM

Hi,

Base on my understanding, you want to let user tab out the control when there is an error.

Please refer to the following article:

Why can't I Tab out of my Control when using data binding?

http://windowsclient.net/blogs/faqs/archive/2006/07/12/why-can-t-i-tab-out-of-my-control-when-using-data-binding.aspx

Why can't I close my Form when using Data Binding?

http://windowsclient.net/blogs/faqs/archive/2006/07/12/why-can-t-i-close-my-form-when-using-data-binding.aspx

Best regards,

Ling Wang


Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Saturday, September 12, 2009 8:37 AM

You can use google to search for other answers

Custom Search

More Threads

• Is there a way to have a Tooltip display for longer than 5 seconds?
• New look TabControl?
• Draw StatusStrip SizingGrip
• Limiting borders on MDI Forms
• SendKeys.Send("{ENTER}") issue and is it dangerous to use it?
• [VB.Net] Drawing and rotating some transparent images
• How to WebBrowser breaks to pages
• comboBox populated on form load
• how to create bitmap area for group box or like frame like controls ,
• Using a Form app's classes in another app