B
BK
In VB.Net (1.1 framework), I have a datagrid that displays records from
a SQL table. Only some of the columns are editable. When the user
changes data in 2 and only 2 of the columns, I want to perform some
calculations. There are about a dozen fields, only 3 of them are
editable and I only want to perform the calculations when the user has
changed the data in either of 2 columns.
I have posed this before without any suggestions that workd. The
Datagrids CurrentCellChanged method works great IF I wanted to always
perform the calculations. However, as I stated above I DON'T want to
do that. CurrentCellChanged fires everytime the user moves around in
the Datagrid.
Ok, so in the Datagrid CurrentCellChanged method I inserted some code
like this:
Me.DsEventLineItemsView.HasChanges(DataRowState.Modified)
The problem I encounter with this code is that it only returns a True
IF the user has moved OFF the row. I MUST perform the calculation when
the user changes the value in either of the 2 columns REGARDLESS of
whether they move to another row.
I also tried:
Me.DsEventLineItemsView.Tables(0).AcceptChanges()
before testing to see if the dataset.HasChanges returns True (that was
suggested to me). That didn't change anything.
The calculations take a lot of work to perform, it kills performance if
I have to do them after every cell change. Any help is appreciated.
Bill
a SQL table. Only some of the columns are editable. When the user
changes data in 2 and only 2 of the columns, I want to perform some
calculations. There are about a dozen fields, only 3 of them are
editable and I only want to perform the calculations when the user has
changed the data in either of 2 columns.
I have posed this before without any suggestions that workd. The
Datagrids CurrentCellChanged method works great IF I wanted to always
perform the calculations. However, as I stated above I DON'T want to
do that. CurrentCellChanged fires everytime the user moves around in
the Datagrid.
Ok, so in the Datagrid CurrentCellChanged method I inserted some code
like this:
Me.DsEventLineItemsView.HasChanges(DataRowState.Modified)
The problem I encounter with this code is that it only returns a True
IF the user has moved OFF the row. I MUST perform the calculation when
the user changes the value in either of the 2 columns REGARDLESS of
whether they move to another row.
I also tried:
Me.DsEventLineItemsView.Tables(0).AcceptChanges()
before testing to see if the dataset.HasChanges returns True (that was
suggested to me). That didn't change anything.
The calculations take a lot of work to perform, it kills performance if
I have to do them after every cell change. Any help is appreciated.
Bill