T
TM
I have a problem with the datagrid where I wanted to detect any changes to
the grid, such as a record being changed, added or deleted. So I used the
currentcellchanged method and used the code
below to update the database. But for some reason, it is detecting and
correctly updating the database on add and remove of records. But is not
writing cell changes back to the database. ANy ideas ?
'this sub will handle if a cell is changed or if a new record is added
Dim dgCell As DataGridCell = grdShoppingList.CurrentCell
Dim strIsle As String = grdShoppingList.Item(dgCell.RowNumber, 0).ToString
Dim strItem As String = grdShoppingList.Item(dgCell.RowNumber, 1).ToString
If strItem.Trim = "0" And strItem.Trim.Length <> 0 Then
'do not add record if it is blank
'write updates to database file and set label to number of records
objShoppingListDA.Update(objShoppingListDataSet, "ShoppingList")
updateShoppingLabel()
End If
ALso, is there any way to force a re-sort of the grid when I add or delete
records so that it is now sorted in the proper order ?
Thanks
the grid, such as a record being changed, added or deleted. So I used the
currentcellchanged method and used the code
below to update the database. But for some reason, it is detecting and
correctly updating the database on add and remove of records. But is not
writing cell changes back to the database. ANy ideas ?
'this sub will handle if a cell is changed or if a new record is added
Dim dgCell As DataGridCell = grdShoppingList.CurrentCell
Dim strIsle As String = grdShoppingList.Item(dgCell.RowNumber, 0).ToString
Dim strItem As String = grdShoppingList.Item(dgCell.RowNumber, 1).ToString
If strItem.Trim = "0" And strItem.Trim.Length <> 0 Then
'do not add record if it is blank
'write updates to database file and set label to number of records
objShoppingListDA.Update(objShoppingListDataSet, "ShoppingList")
updateShoppingLabel()
End If
ALso, is there any way to force a re-sort of the grid when I add or delete
records so that it is now sorted in the proper order ?
Thanks