locked
Validation with a BindingNavigator RRS feed

  • Question

  • If I have a binding navigator I want to be able to validate the stuff in the record before allowing any type of move to another record. I can't find any good way to do this. If the form has invalid data on it, clicking next just goes on to the next record with no way to cancel the navigation. I am beginning to think this is the most worthless control ever created if you can't even validate input. Seriously, is there any way to do the following: When the user clicks add or delete or next or previous or end or beggining or changes position in the position box, STOP, validate record, if valid proceed if not cancel.

    I have looked all over and seen many threads where someone asks the same question but they either get no answer or a wrong answer. Please help

    Thursday, April 2, 2009 7:33 PM

Answers

  • >  I am beginning to think this is the most worthless control ever created

    For all but the simpliest scenarios, you will find that you need to create your own GUI controls and call the BindingSource.Move___ methods.  Since you will be in control of adjusting the position of the BindingSource, you can perform the validation at the appropriate points.
    • Proposed as answer by Harry Zhu Tuesday, April 7, 2009 8:01 AM
    • Marked as answer by Harry Zhu Thursday, April 9, 2009 2:18 AM
    Friday, April 3, 2009 1:37 AM

All replies

  • >  I am beginning to think this is the most worthless control ever created

    For all but the simpliest scenarios, you will find that you need to create your own GUI controls and call the BindingSource.Move___ methods.  Since you will be in control of adjusting the position of the BindingSource, you can perform the validation at the appropriate points.
    • Proposed as answer by Harry Zhu Tuesday, April 7, 2009 8:01 AM
    • Marked as answer by Harry Zhu Thursday, April 9, 2009 2:18 AM
    Friday, April 3, 2009 1:37 AM
  • That's very unfortunate...  I dont know why this is marked answered, in my opinion it's not answered.   I've been searching for a valid resolve for this issue.  And please don't try to put a "band-aid" on it... The bindingsourcenavigator is there for a reason, why should I have to write additional controls?  Then simply don't provide this control and let's not talk about it, that would be even simpler!  There are several posts out there where people are running into the same problem. I've tried several "elegant" ways, I dont want to create lines of code just to delete a record or overcome an issue in the navigator.  It's simple way -- at least its intended as  a simple method, but it needs a few more considerations... What' I'd like to hear is if there is anything in the works to offer a meaningful resolve....  your reply is not a solution, should not be marked answered unless you can offer a valid solution.  I can write controls anyway, why are we using the navigator?   I'm having the issue with the delete confirmation.  What do you suggest?




    Tuesday, February 23, 2010 1:16 AM
  • Microsoft is not adding new features to Windows Forms (see the newer Windows Presentation Foundation).  Thus, the answer is that there is no solution other than "roll your own".

    Fortunately, it is not hard.  The BindingNavigator does not do much.  It is pretty easy to make your own using ToolStrip that does the appropriate calls into BindingSource methods.

    Tuesday, February 23, 2010 1:29 AM