Does anyone know why while working with drv (DataRowView)


a) if I uses this:
--------------------------------------------------------------------
drv.Row.Item("CODE") = 254
--------------------------------------------------------------------
would always make the row state "Modified"


b) if I uses this:
--------------------------------------------------------------------
drv.Item("CODE") = 254
--------------------------------------------------------------------
will sometimes keep the row "Unchanged"


====================================================================
Just to make clear, I do not call .ApplyChanges anywhere and I do not
run the a) and b) lines one after each other. I use them in the same
loop separately and they do sometimes produce different results.
Assigning the value to the DataRowView will always fail to change
the state of the row to the "Modified" if the row is the first in the
DataView. However if I use drv.Row to assign the value, it would change
the state of the row to "Modified".

does anyone have a clue why is it so?

Genadij

Re: <DataRowView> VERSUS <DataRowView.Row> by Miha

Miha
Mon May 30 06:08:57 CDT 2005

Hi,

Perhaps somebody called BeginEdit method?
Try calling EndEdit on DataRowView.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
SLODUG - Slovene Developer Users Group www.codezone-si.info

"[tridy]" <"tridy["@t]takas[dot]lt> wrote in message
news:ODA4eTPZFHA.1152@tk2msftngp13.phx.gbl...
> Does anyone know why while working with drv (DataRowView)
>
>
> a) if I uses this:
> --------------------------------------------------------------------
> drv.Row.Item("CODE") = 254
> --------------------------------------------------------------------
> would always make the row state "Modified"
>
>
> b) if I uses this:
> --------------------------------------------------------------------
> drv.Item("CODE") = 254
> --------------------------------------------------------------------
> will sometimes keep the row "Unchanged"
>
>
> ====================================================================
> Just to make clear, I do not call .ApplyChanges anywhere and I do not
> run the a) and b) lines one after each other. I use them in the same
> loop separately and they do sometimes produce different results.
> Assigning the value to the DataRowView will always fail to change
> the state of the row to the "Modified" if the row is the first in the
> DataView. However if I use drv.Row to assign the value, it would change
> the state of the row to "Modified".
>
> does anyone have a clue why is it so?
>
> Genadij
>
>
>
>



Re: Solved by [tridy]

[tridy]
Tue May 31 00:49:04 CDT 2005

Thank you very much
that indeed solved the problem.

the grid was pointing to that row and
that's why it kept it in edit mode.

regards

Genadij



Miha Markic [MVP C#] wrote:
> Hi,
>
> Perhaps somebody called BeginEdit method?
> Try calling EndEdit on DataRowView.
>