GridView RowUpdating(...) event. How to get the updated row values?

S

Steve Kershaw

Hi,

I'm using the RowUpdating() event of an updatable GridView. I need to
see the values of the columns in the updated row. There has got to be
a way to do this!

Any suggestions?

Thanks in advance!

Steve
 
D

David R. Longnecker

The RowUpdating method has a variable that is of type GridViewUpdateEventArgs
and has two properties that may interest you: OldValues and NewValues.

For an example, if you wanted to see the values onUpdating, you could place
a ListBox control on your page and fill it with this method:

protected void gv_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
ListBox1.Items.Clear();
for (int i = 0; i < e.NewValues.Count; i++)
{
ListBox1.Items.Add(e.NewValues.ToString());
}
}

HTH.

-dl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top