I have a datagrid that displays a few columns from a table.
I need to be able to update a process date on each row if
any of the displayed columns get updated. The process
date ("UPDT_DT") is not in the datagrid. I put an event
handler on the textboxes in the grid so I can capture when
a change occurs, but I can't seem to get the process date
column updated.
Here is the code I tried:
CType
(Me.BindingContextdgLists.DataSource, "UW_LISTS").Current,
DataRowView).Row.Item("UPDT_DT") = Date.Now

The line of code executes but when "UPDT_DT" is updated it
resets the row in the data grid.

Any ideas of how to accomplish this task ?

Re: DataGrid Updating DataSource by Dmitriy

Dmitriy
Thu Aug 21 01:22:53 CDT 2003

Hi John,

First of all, this piece looks a little bit "alien" to me:

> Me.BindingContextdgLists.DataSource

I'd suggest to ensure that the right source is referenced by this property -
just to be safe.

Second, you might try to call AcceptChanges on a row after the
ProcessingDate gets updated. The reason is that the grid's binding manager
could just roll back your change when data grid pushes updated data back to
the data source.

Third, you may try to handle DataView's ListChanged event instead and react
on ItemChanged notifications.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Unit Testing and Integration Environment
http://x-unity.miik.com.ua
Deliver reliable .NET software

"John zink" <john.zink@prudential.com> wrote in message
news:0d9e01c3672b$1afb5740$a401280a@phx.gbl...

> I have a datagrid that displays a few columns from a table.
> I need to be able to update a process date on each row if
> any of the displayed columns get updated. The process
> date ("UPDT_DT") is not in the datagrid. I put an event
> handler on the textboxes in the grid so I can capture when
> a change occurs, but I can't seem to get the process date
> column updated.
> Here is the code I tried:
> CType
> (Me.BindingContextdgLists.DataSource, "UW_LISTS").Current,
> DataRowView).Row.Item("UPDT_DT") = Date.Now
>
> The line of code executes but when "UPDT_DT" is updated it
> resets the row in the data grid.
>
> Any ideas of how to accomplish this task ?