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 Forms
  4. Toolbar or BindingNavigator?

Toolbar or BindingNavigator?

Scheduled Pinned Locked Moved Windows Forms
csharpvisual-studioquestion
7 Posts 2 Posters 0 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.
  • A Offline
    A Offline
    aharrisreid
    wrote on last edited by
    #1

    I am in the process of designing a generic 'record maintenance' toolbar class containing the 'standard' add/edit/delete/save/cancel buttons. I notice that the VS toolbox already has a bindingnavigator control which already has some of the functionality that I require (although I don't require the navigation buttons). Which control should I go for? As far as I can see the bindingnavigator is just a glorified toolbar bound directly to a datasource, but I may be missing something. Can I subclass a toolbar/bindingnavigator visually or does it have to be done in code? I am using C# with VS2005 express. TIA Alan

    K 1 Reply Last reply
    0
    • A aharrisreid

      I am in the process of designing a generic 'record maintenance' toolbar class containing the 'standard' add/edit/delete/save/cancel buttons. I notice that the VS toolbox already has a bindingnavigator control which already has some of the functionality that I require (although I don't require the navigation buttons). Which control should I go for? As far as I can see the bindingnavigator is just a glorified toolbar bound directly to a datasource, but I may be missing something. Can I subclass a toolbar/bindingnavigator visually or does it have to be done in code? I am using C# with VS2005 express. TIA Alan

      K Offline
      K Offline
      kuyak2000
      wrote on last edited by
      #2

      aharrisreid wrote:

      I am in the process of designing a generic 'record maintenance' toolbar class containing the 'standard' add/edit/delete/save/cancel buttons. I notice that the VS toolbox already has a bindingnavigator control which already has some of the functionality that I require (although I don't require the navigation buttons). Which control should I go for? As far as I can see the bindingnavigator is just a glorified toolbar bound directly to a datasource, but I may be missing something. Can I subclass a toolbar/bindingnavigator visually or does it have to be done in code? I am using C# with VS2005 express.

      You can just use Windows Forms' BindingSource and create a decent ToolStrip (previously known as ToolBar in .NET 1.x), with your own buttons with custom actions. Any data binding applications in Windows Forms can do navigating by just using BindingSource with a valid DataSource such as DataSet or DataTable. Start from this: http://msdn2.microsoft.com/en-us/library/ef2xyb33.aspx[^] Eriawan

      A 1 Reply Last reply
      0
      • K kuyak2000

        aharrisreid wrote:

        I am in the process of designing a generic 'record maintenance' toolbar class containing the 'standard' add/edit/delete/save/cancel buttons. I notice that the VS toolbox already has a bindingnavigator control which already has some of the functionality that I require (although I don't require the navigation buttons). Which control should I go for? As far as I can see the bindingnavigator is just a glorified toolbar bound directly to a datasource, but I may be missing something. Can I subclass a toolbar/bindingnavigator visually or does it have to be done in code? I am using C# with VS2005 express.

        You can just use Windows Forms' BindingSource and create a decent ToolStrip (previously known as ToolBar in .NET 1.x), with your own buttons with custom actions. Any data binding applications in Windows Forms can do navigating by just using BindingSource with a valid DataSource such as DataSet or DataTable. Start from this: http://msdn2.microsoft.com/en-us/library/ef2xyb33.aspx[^] Eriawan

        A Offline
        A Offline
        aharrisreid
        wrote on last edited by
        #3

        Hi kuyak2000, thanks for the reply.

        You can just use Windows Forms' BindingSource and create a decent ToolStrip (previously known as ToolBar in .NET 1.x), with your own buttons with custom actions.

        The problem with the BindingSource is that I don't require the navigation buttons, which only leaves the add and delete buttons, so I would have to add my own edit/save/cancel buttons. It might make more sense for me to create my own customised toolstrip. Regards, Alan

        K 1 Reply Last reply
        0
        • A aharrisreid

          Hi kuyak2000, thanks for the reply.

          You can just use Windows Forms' BindingSource and create a decent ToolStrip (previously known as ToolBar in .NET 1.x), with your own buttons with custom actions.

          The problem with the BindingSource is that I don't require the navigation buttons, which only leaves the add and delete buttons, so I would have to add my own edit/save/cancel buttons. It might make more sense for me to create my own customised toolstrip. Regards, Alan

          K Offline
          K Offline
          kuyak2000
          wrote on last edited by
          #4

          aharrisreid wrote:

          The problem with the BindingSource is that I don't require the navigation buttons, which only leaves the add and delete buttons, so I would have to add my own edit/save/cancel buttons. It might make more sense for me to create my own customised toolstrip.

          Using VS 2005 IDE, you can just add BindingSource by dropping from toolbox, and then start to create your own ToolStrip with your own data manipulation buttons. Dropping BindingSource doesn't create new BindingNavigator on your Form. regards, Eriawan :)

          A 1 Reply Last reply
          0
          • K kuyak2000

            aharrisreid wrote:

            The problem with the BindingSource is that I don't require the navigation buttons, which only leaves the add and delete buttons, so I would have to add my own edit/save/cancel buttons. It might make more sense for me to create my own customised toolstrip.

            Using VS 2005 IDE, you can just add BindingSource by dropping from toolbox, and then start to create your own ToolStrip with your own data manipulation buttons. Dropping BindingSource doesn't create new BindingNavigator on your Form. regards, Eriawan :)

            A Offline
            A Offline
            aharrisreid
            wrote on last edited by
            #5

            Hi Eriawan, thanks for the reply.

            kuyak2000 wrote:

            Using VS 2005 IDE, you can just add BindingSource by dropping from toolbox, and then start to create your own ToolStrip with your own data manipulation buttons. Dropping BindingSource doesn't create new BindingNavigator on your Form.

            I think I understand what you are saying, but how do I use toolstrip buttons in conjunction with the bindingsource to achieve the required action? For example, say I have a 'Save' button on the strip. What sort of code would it have called from the Click method which saves data back to the database? Can you point me to any examples? Any help would be appreciated. Alan

            K 1 Reply Last reply
            0
            • A aharrisreid

              Hi Eriawan, thanks for the reply.

              kuyak2000 wrote:

              Using VS 2005 IDE, you can just add BindingSource by dropping from toolbox, and then start to create your own ToolStrip with your own data manipulation buttons. Dropping BindingSource doesn't create new BindingNavigator on your Form.

              I think I understand what you are saying, but how do I use toolstrip buttons in conjunction with the bindingsource to achieve the required action? For example, say I have a 'Save' button on the strip. What sort of code would it have called from the Click method which saves data back to the database? Can you point me to any examples? Any help would be appreciated. Alan

              K Offline
              K Offline
              kuyak2000
              wrote on last edited by
              #6

              It's quite easy. - First you have to validate the form using Form.Validate() method, - End the edit of bindingsource used using BindingSource.EndEdit() method. - Save the datasource. If you're using TableAdapter, just use Update() method Good luck! best regards, Eriawan :)

              A 1 Reply Last reply
              0
              • K kuyak2000

                It's quite easy. - First you have to validate the form using Form.Validate() method, - End the edit of bindingsource used using BindingSource.EndEdit() method. - Save the datasource. If you're using TableAdapter, just use Update() method Good luck! best regards, Eriawan :)

                A Offline
                A Offline
                aharrisreid
                wrote on last edited by
                #7

                Hi Eriawan, That was easier than I thought it would be. I'll try it out asap.. Thanks, Alan

                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