I am using Telerik ASP.NET AJAX Version 2012.1.411.40. I have a page where the user enters some search criteria and the search results are returned and displayed in a radGrid on the page. If the entry in the grid is editable, an edit pencil is displayed. When the user clicks the edit pencil, a custom edit form is displayed in a radWindow. This window is opened from the codebehind (I need to pass several values to the edit form so that I know which record I need to edit) in the OnClick event handler using the following code:
Buttons are available on the edit form for the user to delete the entry, save the information, or cancel. If the user clicks delete, I use radconfirm to display a confirmation message. If the user choses to continue with the delete, the record is deleted, the radwindow is closed and the radgrid is rebound. If the user clicks save, the information is saved, the radwindow is closed and the radgrid is rebound. If the user clicks cancel, the radwindow is closed. That all seems to be working. Now I need to detect if the user changed any information. If data has been changed, I need to use radconfirm to warn the user about unsaved changes if they click cancel or try to close the edit window. I don't want to warn the user if they click save or if they close the edit window without changing any information. I've searched through the forums for guidance but haven't been able to connect the dots to get this to work the way I need it to. At one point, I had it working where I got a valid unsaved changes warning (not using radconfirm though) when the cancel was clicked. But when I tried to close the edit window, the radwindow closed and then displayed the warning which is not the order I'm looking for.
Any suggestions on how I can do this?
Thanks
rwinEditCustomer.Modal =
true;
rwinEditCustomer.NavigateUrl =
String.Format("CustomerAddEdit.aspx?source={0}&addrid={1}&cntctid={2}", lblSource.Text, hdnAddressId.Value, hdnContactId.Value);
string script = "function f(){$find(\"" + rwinEditCustomer.ClientID + "\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "winEditCust", script, true);
Buttons are available on the edit form for the user to delete the entry, save the information, or cancel. If the user clicks delete, I use radconfirm to display a confirmation message. If the user choses to continue with the delete, the record is deleted, the radwindow is closed and the radgrid is rebound. If the user clicks save, the information is saved, the radwindow is closed and the radgrid is rebound. If the user clicks cancel, the radwindow is closed. That all seems to be working. Now I need to detect if the user changed any information. If data has been changed, I need to use radconfirm to warn the user about unsaved changes if they click cancel or try to close the edit window. I don't want to warn the user if they click save or if they close the edit window without changing any information. I've searched through the forums for guidance but haven't been able to connect the dots to get this to work the way I need it to. At one point, I had it working where I got a valid unsaved changes warning (not using radconfirm though) when the cancel was clicked. But when I tried to close the edit window, the radwindow closed and then displayed the warning which is not the order I'm looking for.
Any suggestions on how I can do this?
Thanks