• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 308
  • Last Modified:

casting to FormViewUpdatedEventArgs

How do I make a casting to  EventArgs e to be FormViewUpdatedEventArgs tempe ?
Is it possible? I need to know if a value had been changed and I have to check it not in the ItemUpdated event.

protected void btnGORecruit_Click(object sender, EventArgs e)
{
                FormViewUpdatedEventArgs tempe = (FormViewUpdatedEventArgs)e;
}
This command is wrong. HOw do I do something like this?
Thankyou
ANat
0
ANAT2403
Asked:
ANAT2403
  • 3
  • 2
  • 2
1 Solution
 
harshitsCommented:
Hi ANAT2403,

It is not possible to do such a casting. Can you clarify as to what you are trying to achieve by doing such a type cast? May be we can work around some other way to do that.

Harshit Sheth
0
 
ANAT2403Author Commented:
I need to know if a value in a dropdownlist had been changed before I update it.
If it was changed I have to update another field .  I am doing the update manually not
through the ItemUpdated event so I wanted to check if a change had been dont to the value?
Thankyuou
Anat
0
 
harshitsCommented:
Here something you might be able to do.

In the ItemUpdated of the FormView, you can check if any change has occurred in the dropdownlist, and then save this value in some kind of a variable may be even a Session.

After that you can do whatever update you need to do in the btnGORecruit_Click event depending on the value of the Session variable.

Harshit Sheth
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
ANAT2403Author Commented:
But I tried to explain that this is the whole issue!
I don't go through ItemUpdated of the formview.
I have a filed that I have to update separately and I want to know if there was or there wasn't a change
with the originol value of this field.
Thankyou
Anat
0
 
whityumCommented:
why not do something like:
if(((DropDownList)FormView1.FindControl("DropDownList1")).SelectedValue != OriginalValueVariable){
//do stuff
}
0
 
ANAT2403Author Commented:
How will I get OriginalValueVariable?
0
 
whityumCommented:
you would have to set it when you load the page or check against the database value

how are you loading this formview?  it should be databound to something, check it against the data.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now