Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows Development
  4. Binding

Binding

Scheduled Pinned Locked Moved Windows Development
csharpwpfwinformswcf
9 Posts 5 Posters 17 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    michaelbarb
    wrote on last edited by
    #1

    Why has Binding never caught on in Windows Forms. I have been using binding in Wpf for years. Have not paid much attention to Windows Forms. Someone just pointed out that Windows Forms has binding. Looking it up they have had it since .Net2. Occasionally I have had to maintain a Windows Forms app and have never seen it used.

    So many years of programming I have forgotten more languages than I know.

    L S 3 Replies Last reply
    0
    • M michaelbarb

      Why has Binding never caught on in Windows Forms. I have been using binding in Wpf for years. Have not paid much attention to Windows Forms. Someone just pointed out that Windows Forms has binding. Looking it up they have had it since .Net2. Occasionally I have had to maintain a Windows Forms app and have never seen it used.

      So many years of programming I have forgotten more languages than I know.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I have used binding for more than 10 years in Windows Forms projects.

      1 Reply Last reply
      0
      • M michaelbarb

        Why has Binding never caught on in Windows Forms. I have been using binding in Wpf for years. Have not paid much attention to Windows Forms. Someone just pointed out that Windows Forms has binding. Looking it up they have had it since .Net2. Occasionally I have had to maintain a Windows Forms app and have never seen it used.

        So many years of programming I have forgotten more languages than I know.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        If one never leaves the Designer, and believes all the "no code behind", then one never learns about Windows Forms binding, etc. It's when you start writing your own framework(s) and patterns that all this starts to come to the surface. For some, that is a bad thing ("details").

        It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food

        1 Reply Last reply
        0
        • M michaelbarb

          Why has Binding never caught on in Windows Forms. I have been using binding in Wpf for years. Have not paid much attention to Windows Forms. Someone just pointed out that Windows Forms has binding. Looking it up they have had it since .Net2. Occasionally I have had to maintain a Windows Forms app and have never seen it used.

          So many years of programming I have forgotten more languages than I know.

          S Offline
          S Offline
          Samir Ibrahim
          wrote on last edited by
          #4

          Binding is Good(Less coding) and Bad(more code to control) If you want full control on your form workflow, don't use binding If you bind a control (textbox) to datasource (access or mssql) to field ID (AutoNumber) and you want to add new record, the textbox will display -1 (you have more coding to prevent it) sometimes you will not be able to leave textbox binded to numberic (int,dec) empty (blank), unless you enter a value (you have more coding to allow it) binding is powerful and easy if used with dataset, but not easy if used with LinqToSql or EF In my form, I use binding and manual where necessary.

          L R R 3 Replies Last reply
          0
          • S Samir Ibrahim

            Binding is Good(Less coding) and Bad(more code to control) If you want full control on your form workflow, don't use binding If you bind a control (textbox) to datasource (access or mssql) to field ID (AutoNumber) and you want to add new record, the textbox will display -1 (you have more coding to prevent it) sometimes you will not be able to leave textbox binded to numberic (int,dec) empty (blank), unless you enter a value (you have more coding to allow it) binding is powerful and easy if used with dataset, but not easy if used with LinqToSql or EF In my form, I use binding and manual where necessary.

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Samir Ibrahim wrote:

            If you bind a control (textbox) to datasource (access or mssql) to field ID (AutoNumber) and you want to add new record, the textbox will display -1 (you have more coding to prevent it)

            Never show the autoId to a user. If you need an ID for the user, add a column for it, but don't use the PK. Binding is cheap.

            Bastard Programmer from Hell :suss: "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

            S 1 Reply Last reply
            0
            • S Samir Ibrahim

              Binding is Good(Less coding) and Bad(more code to control) If you want full control on your form workflow, don't use binding If you bind a control (textbox) to datasource (access or mssql) to field ID (AutoNumber) and you want to add new record, the textbox will display -1 (you have more coding to prevent it) sometimes you will not be able to leave textbox binded to numberic (int,dec) empty (blank), unless you enter a value (you have more coding to allow it) binding is powerful and easy if used with dataset, but not easy if used with LinqToSql or EF In my form, I use binding and manual where necessary.

              R Offline
              R Offline
              RobertSF
              wrote on last edited by
              #6

              I've come to realize there's no point in binding the autonumber/PK because, at most, it's only used for display. It's not something the user can edit. I display it in a label, using "New" when it's -1.

              S 1 Reply Last reply
              0
              • S Samir Ibrahim

                Binding is Good(Less coding) and Bad(more code to control) If you want full control on your form workflow, don't use binding If you bind a control (textbox) to datasource (access or mssql) to field ID (AutoNumber) and you want to add new record, the textbox will display -1 (you have more coding to prevent it) sometimes you will not be able to leave textbox binded to numberic (int,dec) empty (blank), unless you enter a value (you have more coding to allow it) binding is powerful and easy if used with dataset, but not easy if used with LinqToSql or EF In my form, I use binding and manual where necessary.

                R Offline
                R Offline
                RedDk
                wrote on last edited by
                #7

                Samir Ibrahim wrote:

                you have more coding to prevent it

                Perhaps this is the reason why one CANNOT access the DESCRIPTION field; there is no code to prevent anything (thank-you MS). Example: How to set DESCRIPTION field in system catalog using code[^]

                1 Reply Last reply
                0
                • R RobertSF

                  I've come to realize there's no point in binding the autonumber/PK because, at most, it's only used for display. It's not something the user can edit. I display it in a label, using "New" when it's -1.

                  S Offline
                  S Offline
                  Samir Ibrahim
                  wrote on last edited by
                  #8

                  >>at most, it's only used for display. It's not something the user can edit. I display it in a label It can be used for entering a number to search for, so I don't bind the PK to a textbox, I handle it manually.

                  1 Reply Last reply
                  0
                  • L Lost User

                    Samir Ibrahim wrote:

                    If you bind a control (textbox) to datasource (access or mssql) to field ID (AutoNumber) and you want to add new record, the textbox will display -1 (you have more coding to prevent it)

                    Never show the autoId to a user. If you need an ID for the user, add a column for it, but don't use the PK. Binding is cheap.

                    Bastard Programmer from Hell :suss: "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

                    S Offline
                    S Offline
                    Samir Ibrahim
                    wrote on last edited by
                    #9

                    >> add a column for it, but don't use the PK. That will require creating another table to handle the numbering for your application plus coding to handle the incremented value in that column, well, simply, I don't bind the PK, I handle it manually.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups