databinding question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Wan

    #1

    databinding question

    Hi,
    I have a vb.net form with some controls on it, let says, combobox,
    text, comment, etc. databinding
    to a dataset. I also have a save button that when click will update the
    changes to a dataset. The save button is disabled when form is first
    loaded. As soon as the user edits or changes one of the values in an
    editable control, I would like to enable the save button. What is the
    most efficient way to do this? I used in the past is to check
    TextChanged (or ValueChanged or whatever) event of the control itself
    to enable/disable save button. I'm open to ideas. Thanks for the
    assistance.

    Regards,
    Wan

  • Cor Ligthert [MVP]

    #2
    Re: databinding question

    Wan,

    If you use databinding, than the fields are from the second binding
    parameter are always direct put in the properties as is described in the
    first. To have an easy look at it, try this, drag 2 textboxes on a form and
    than use this code in the load event.

    textbox2.databi ndings.add("Tex t",Textbox1,"Te xt")

    and try that.

    There is no save button needed, that you can use to push the changed data
    from your dataset in the database.

    I hope this gives an idea.

    Cor

    "Wan" <wandii@yahoo.c omschreef in bericht
    news:1166125940 .678943.177570@ 79g2000cws.goog legroups.com...
    Hi,
    I have a vb.net form with some controls on it, let says, combobox,
    text, comment, etc. databinding
    to a dataset. I also have a save button that when click will update the
    changes to a dataset. The save button is disabled when form is first
    loaded. As soon as the user edits or changes one of the values in an
    editable control, I would like to enable the save button. What is the
    most efficient way to do this? I used in the past is to check
    TextChanged (or ValueChanged or whatever) event of the control itself
    to enable/disable save button. I'm open to ideas. Thanks for the
    assistance.
    >
    Regards,
    Wan
    >

    Comment

    • RobinS

      #3
      Re: databinding question

      I don't know of any way to do what you're talking about,
      other than putting change events in all the textboxes.
      On the bright side, you can subscribe all the textboxes'
      change events to one routine. Same for the comboboxes.
      Post back if you need some code to show you how to do that.

      Robin S.
      ------------------
      "Wan" <wandii@yahoo.c omwrote in message
      news:1166125940 .678943.177570@ 79g2000cws.goog legroups.com...
      Hi,
      I have a vb.net form with some controls on it, let says, combobox,
      text, comment, etc. databinding
      to a dataset. I also have a save button that when click will update
      the
      changes to a dataset. The save button is disabled when form is first
      loaded. As soon as the user edits or changes one of the values in an
      editable control, I would like to enable the save button. What is the
      most efficient way to do this? I used in the past is to check
      TextChanged (or ValueChanged or whatever) event of the control itself
      to enable/disable save button. I'm open to ideas. Thanks for the
      assistance.
      >
      Regards,
      Wan
      >

      Comment

      Working...