Gridview Previous value in RowDataBound

Gridview Previous value in RowDataBound

am 23.01.2008 15:43:00 von rlm

I have a gridview, and in the RowDataBound event I do some processing on the
data. I need to know if the one of the columns has changed from its previous
value, but I do not see how to get the previous value. Doesn't viewstate have
that already?

I know I can access the current value with e.Row.Cells[0].Text, and I know I
can access a value in ViewState which I have added like ViewState["Status"].
What I want is something like this.
if(e.Row.Cells[0].OldValue.Text != e.Row.Cells[0].Text){
DoSomething();
}

Re: Gridview Previous value in RowDataBound

am 23.01.2008 15:52:37 von Eliyahu Goldin

OldValues collection is available in RowUpdated and RowUpdating events but
not in RowDataBound.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"rlm" wrote in message
news:4182D059-570D-4A9B-955C-9DAC745DB22A@microsoft.com...
>I have a gridview, and in the RowDataBound event I do some processing on
>the
> data. I need to know if the one of the columns has changed from its
> previous
> value, but I do not see how to get the previous value. Doesn't viewstate
> have
> that already?
>
> I know I can access the current value with e.Row.Cells[0].Text, and I know
> I
> can access a value in ViewState which I have added like
> ViewState["Status"].
> What I want is something like this.
> if(e.Row.Cells[0].OldValue.Text != e.Row.Cells[0].Text){
> DoSomething();
> }