I have a Datagrid that is bound to a typed dataset that is loaded from a SQL database. While typing data in a new row on grid the other column cell values all contain the value "(null)".I cannot present something like this to a client. Is there any way of formatting the new row to present empty or default values ?
Danny van der Walt
Posts
-
(nulls) display problem in datagrid new row -
Passing data from datagrid to DatasetApology accepted. Thing is, it IS as simple as your hip shot. The Grid DOES affect the datasource and visa versa. The dataset.acceptchanges statement just before the dataAdapter.updatedataset part appears to be the stoolsample in the applepie. It changes all rowstates from deleted, added to unchanged. Which in turn must be telling the adapter that nothing happened. Took out ds.acceptchanges and problem solved.
-
Passing data from datagrid to DatasetAny changes to the dataset reflects on the grid, but not visa versa. Either I am missing something, because it seems some intervention is needed. On the CurrentCellChanged event I have to add the following line (assuming the datasource is a dataset of course) Static PrevCell As DataGridCell Dim dsSender as Dataset dsSender.Tables(0).Rows(PrevCell.RowNumber).Item(PrevCell.ColumnNumber) = PrevCellData 'becomes prev cell on next itteration PrevCell = sender.CurrentCell Only then does ds.AcceptChanges and da.update(ds) work. I am not even talking about adding new records yet. Any suggestions to simplify the process would be appreciated.
-
Passing data from datagrid to DatasetHow can I get the changes made by a user to a datagrid's content to reflect in the "datasourced" dataset so that the database can be updated accordingly ? This is for a desktop program not asp. The dataset is filled by an SqlDataAdapter