This is a migrated thread and some comments may be shown as answers.

Confirm on radgrid update

1 Answer 34 Views
Window
This is a migrated thread and some comments may be shown as answers.
Frank
Top achievements
Rank 1
Frank asked on 29 Mar 2012, 01:19 PM
I have a screen that contains a radgrid on it, when the user clicks to add a new record and they enter the new info I do a check to see if it is a possible duplicate.  If it is I want to display a Confirm message box that will inform them that it is a possible dup, but allow them to add the record.
I am currently using a messagebox but would like to use a radwindow, but when I add an even hadler I do not see a way to pass the data to the new method.  Or should I try and read the active row of the grid after the confrim?

public void UpdateTransaction(object sender, Telerik.Windows.Controls.GridViewRowEditEndedEventArgs e)
       {
           EditData ed = new EditData();
           FundTransaction trans = (FundTransaction)e.NewData;
 
           if (trans.FundID != null && trans.TickerID != null)           {
               string result = ed.EditFundTransaction(trans.TransactionID, trans.FundID); 
               if (result != "")
               {
                   if (MessageBox.Show(result, "Confirmation", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                   {
                       ImportData id = new ImportData();
                       id.AddTransaction(trans.FundID, trans.TickerID);                   }
 
                  }
           }
       }

1 Answer, 1 is accepted

Sort by
0
Ivo
Telerik team
answered on 03 Apr 2012, 09:38 AM
Hello,

The easiest way to achieve this is to use a lambda expression. Here is an example:
RadWindow.Confirm("Some Content", (s, args) =>
{
    //this code will be executed when the RadConfirm is closed
    if (args.DialogResult.HasValue && args.DialogResult.Value == true)
    {
 
    }
    else
    {
 
    }
});

I hope this helps you.

Greetings, Ivo
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Window
Asked by
Frank
Top achievements
Rank 1
Answers by
Ivo
Telerik team
Share this question
or