vbnetlearner
Member
- Joined
- Aug 10, 2006
- Messages
- 13
- Programming Experience
- Beginner
I have a vb.net form that has a datagrid. New rows are to datagrid by click of a button. Code to add rows into datagrid is in the click event of the button and has datagrid linked to a datatable. So datagrid.datasource is datatable. The button click event calls a SQL stored procedure that gets information for the row and fills the datatable which inturn will populate datagrid because it is linked to datatable.
When I click the button to add new row, it successfully adds new row. If old rows already exist on the datagrid, it successfully appends new row. So far so good. The problem I have is when I click into the datagrid. When I click into the datagrid and then click on button to add new row, it deletes all old rows and creates a new row and that will be the first row in the grid, instead it should have simply appended to old list.
Could someone please help as I am stuck with this for a long time. I need to urgently move on.
Thanks
When I click the button to add new row, it successfully adds new row. If old rows already exist on the datagrid, it successfully appends new row. So far so good. The problem I have is when I click into the datagrid. When I click into the datagrid and then click on button to add new row, it deletes all old rows and creates a new row and that will be the first row in the grid, instead it should have simply appended to old list.
Could someone please help as I am stuck with this for a long time. I need to urgently move on.
Thanks