|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ADO RowState problemdatagrid bound to a dataset. I want to perform some database updates when the user edits certain fields of data. Consider the following code: If Me.DsEventLineItemsView.Tables(0).Rows(Me.LastCell.RowNumber).RowState = DataRowState.Modified Then ..... code here to handle the updated information End If My problem is that this only works when the user moves off the datagrid line. If the user changes a column and DOES NOT move off the line, the DataRowState is Unchanged. That REALLY SUCKS. What am I missing here? How can I detect a change WITHOUT the user moving off the line? There are times when the datagrid only has 1 record in it. These calculations are lengthy and we don't want to perform them unless the user has truly changed something. Any help is appreciated. Bill Perhaps you could use the DataGrid's CurrentCellChanged event.
This would only fire if the user changes something. So you don't need to do a state check on your row. You already know once that event is handled that the current cell has indeed changed and needs calculations. Thanks for the reply. I am using the DataGrid's CurrentCellChanged
event. That event fires anytime the user moves from cell to cell, regardless of wheter they've changed anything. What I need is an event that truly signals if a cell has changed. Any other thoughts? BTW, I'm sorry about posting to 2 newsgroups, I didn't realize that was improper netiquette. BK,
Will you please be so kind not to multipost, I have given an answer in another newsgroup on this question. Crossposting is no problem which is sending one message to more newsgroups. Cor Show quoteHide quote "BK" <bkunn***@hotmail.com> schreef in bericht news:1142980090.407624.230600@u72g2000cwu.googlegroups.com... > I'm going nuts here trying to figure this out. In a winform, I have a > datagrid bound to a dataset. I want to perform some database updates > when the user edits certain fields of data. Consider the following > code: > > If > Me.DsEventLineItemsView.Tables(0).Rows(Me.LastCell.RowNumber).RowState > = DataRowState.Modified Then > .... code here to handle the updated information > End If > > My problem is that this only works when the user moves off the datagrid > line. If the user changes a column and DOES NOT move off the line, the > DataRowState is Unchanged. That REALLY SUCKS. What am I missing here? > How can I detect a change WITHOUT the user moving off the line? There > are times when the datagrid only has 1 record in it. These > calculations are lengthy and we don't want to perform them unless the > user has truly changed something. Any help is appreciated. > > Bill >
Object variable or With block variable not set
PrintPreview problem Flashing when switching mdi forms Page_Load vs Submit_Click - which one first? sql question rounding time How are items added to VB2003 Tools menu item Destroying objects list box to combo box MSCOMM.OCX and Exception from HRESULT: 0x800A1F52 |
|||||||||||||||||||||||