Datagrid new record becomes blank?

doraemon

Freshman
Joined
Oct 3, 2003
Messages
36
I added a new record to the datagrid, programmatically setting some default values to the required columns, but if I don't make any changes to at least one cell and tried to click the save button, all the cells will be wiped out. And as I click the Save button I would get a message saying that there is nothing to save (I programmed the message it there when the user is trying to save a dataset with no changes). But, some fields are optional and if the default values are correct, there is really no need to make any change but just to insert the record as is. Is there anything I need to do to have the data stay?

This is how I added the new record:

CType(dg.DataSource, DataTable).DefaultView.AllowNew = True
dg.CurrentCell = New(DataGridCell(_currencyManager.Count, 2)
dg.Item(dgTaskAssignment.CurrentRowIndex, 1) = DefaultValue
dg.Item(dgTaskAssignment.CurrentRowIndex, 3) = Today
 
Back
Top