Hi all,
I need the way forward on this problem , any assistance will help. I have a project am working on and within the project i defined a data table (H_dt) with columns which loads data on a datagridview (DGViewitems) control row after row.
i thought of a scenario where the user might want to delete the last row or delete all the row from bottoms up ( bottom to top). so i tried this code under the "delete" button click event:
H_dt.rows(H_dt.rows.count-1).delete
but i noticed that when run this command i don't notice any change(physical change in removal of the last row) on the datagrid view, but when i add an item to the to the datagrid view via the data table the item i deleted is removed before the new item or row is added, this implies that the code in the delete button click event actually deleted the last row but the changes to the datagrid view were not just physically effected immediately, so how can i achieve this so that when the user deletes the last row he or she can see it effected right away. before they start adding new items or rows.
i also have the same problem for this line of command which is under the "clear all" button click event which clears all chosen or selected orders or existing rows.
H_dt.row.clear
all the items are actually cleared but the change doesn't seem to be effected physically on the control.
but when you start adding new items , the grid will be cleared and your new selections will be added row by row.
also i tried running this command under the "delete" button click event
DGViewitems.rows.clear (i.e running the code directly on the datagrid control)
but i get an error message "Cannot clear this list"
please note that the data table is not bound to any database table or dataset.
regards
ade