Confirm on radgrid update

2 posts, 0 answers
  1. Frank
    Frank avatar
    95 posts
    Member since:
    Mar 2012

    Posted 29 Mar 2012 Link to this post

    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);                   }
  2. Ivo
    Ivo avatar
    390 posts

    Posted 03 Apr 2012 Link to this post


    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)

    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 >>
Back to Top