toolbar for dataset (how do i make one?)

i checked out the beginner videos and they were really useful. i added a dataset and when i dragged the table in datagridview onto the working area, a data grid pops up with a nice toolbar on top with the usual functions like adding, deleting and saving.

i thought i didn't need the toolbar so i deleted it. now that i want one, how do i add one i tried dragging another datagridview onto the working area, and a data grid shows up WITHOUT a toolbar

any help



Answer this question

toolbar for dataset (how do i make one?)

  • ErikH

    Maybe this will work (If I understand correctly what you're trying to do)

    Go into the ButtonClick event of the button that you want to to fire the "Add New", and paste the following line of code.

    Me.BindingSource.AddNew()

    Just make sure you use the correct name for your BindingSource.

    My apologies if this is logically wrong or does not work. I'm a bonafide rookie myself.




  • cgsdev

    thoughtmacat wrote:

    To solve your problem, just need to do this

    You should delete the datagrid view, and all components in the component tray. Then you can drag dataset again on your work area, it will rebuild all new items for your application.

    to locate the component tray, in the design tab, you can scroll down and see a small rectangle that is the component tray.

    That's it

    Good luck...

    awesome! thanks man! well, is there a way to copy the functionalities of the buttons on the toolbar (like the add, delete and save buttons) to other buttons on the work area i was able to do so for the save button, by double clicking it and copying the code on it to the section of my other save button, and it works. i tried to do the same on the, let's say add button, and there's no code on the event of clicking it weird, but the add button on the toolbar works! same on the other buttons like the delete button


  • Dave1111

    Do you mean that you want to write your own code that do the same functionalities as the navigate toolbar does

    If it is your right question, you can try the following code.

    BindingSource.EndEdit()

    TableAdapter.Update(DatabaseDataSet.TableName)

    That's all

    Good luck...


  • pmquan

    To solve your problem, just need to do this

    You should delete the datagrid view, and all components in the component tray. Then you can drag dataset again on your work area, it will rebuild all new items for your application.

    to locate the component tray, in the design tab, you can scroll down and see a small rectangle that is the component tray.

    That's it

    Good luck...


  • Delucia

    yup! but i tried that one already and it works. it's for updating/saving the changes and all right anyway, what i'd like to do is add buttons to insert a new row, and delete a row in my database since the toolbar has those capabilities, i was wondering if i could copy their functionalities onto other buttons
  • Ver Argulla Jr.

    just to add, i tried deleting everything and made a new dataset, and dragged the datagridview onto the work area, and the toolbar was created. so, can't i make one that isn't the 1st instance of the dataset i'd hate to have to redo everything i did already
  • PaulTH

    anyone
  • toolbar for dataset (how do i make one?)