How can I add a new row to an UltraWinGrid?
We have a 3rd party VB.NET application that uses an UltraWinGrid. The apps allow the user to modify the data ~ user can edit existing records or add new rows depending on the distribution of quantity they want.The uwgrid gets bind to a datatable:
Dim dtpackets as DataTable = Package.GetPackets(PkgID)
uwGrid.DataSource = dtPackets
Whatever is returned get shown on the grid and allow user to edit it. But now we want also to be able to add new row so they can distribute quantity however they want. Before a package can have 2 packets with 100 each, now users can modify to make this 4 packets 50 each or 3 packets (100, 50, 50). We have an "Add Row" button that will allow user to add rows as many as they want.
Your time and effort is greatly appreciated.
You can add a new row in 2 ways. Your add new button could call:
uwGrid.DisplayLayout.Bands(0).AddNew()
Or you could add the following line when you populate the grid to give the user a fixed row to add new records:
uwGrid.DisplayLayout.Override.AllowAddNew = AllowAddNew.FixedAddRowOnTop
The first one is what I'm looking for, it works!
I was looking at the rows collection thinking there is an AddRow method!?
You are a godsend, may the angels sing praise for you!
Thank you very much.
KenjiK