RadWindow.Confirm() - passing an object

5 posts, 0 answers
  1. GEB
    GEB avatar
    228 posts
    Member since:
    Dec 2008

    Posted 28 Jan 2009 Link to this post

    I need to confirm an action by the user using the Confirm() method.  Is there any way to pass an object into the OnClosed() event as part of the confirmation?  For example, I want to have the user confirm that they want to delete a transaction.  If they answer YES, I need the transaction object as part of the OnClosed() event to know how to properly delete various records from a database associated with the transaction.  Currently, I'm setting a global object, but I consider this to be a bad coding practice.  Any recommendations?

    If there is a way of doing this, I would recommend this as an additional to your samples.  The Confirm() and Prompt() examples today are not very "real world", as objects typically need to be accessed when confirmation is given by the user.
  2. Hristo Borisov
    Admin
    Hristo Borisov avatar
    298 posts

    Posted 29 Jan 2009 Link to this post

    Hello Gary,

    Currently you cannot achieve your goal using our latest version of RadWindow. I do agree that such feature would be very helpful and we will closely evaluate the importance of such feature for our future release. Thank you for suggesting this feature, your telerik points have been updated.

    Sincerely yours,
    Hristo Borisov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft banner
  4. andrew rekvils
    andrew rekvils avatar
    18 posts
    Member since:
    Dec 2005

    Posted 08 Apr 2009 Link to this post

    This feature is a MUST. Without it confirmation window is pretty much useless.

  5. Hristo Borisov
    Admin
    Hristo Borisov avatar
    298 posts

    Posted 09 Apr 2009 Link to this post

    Hello andrew rekvils,

    If you want to avoid the declaration of variables in your class you can just delegate the OnClose method like this:
            private void btnConfirm_Click(object sender, RoutedEventArgs e)  
            {  
                int steps = 5;  
     
                RadWindow.Confirm("Are you sure you want to increment steps?"new EventHandler<WindowClosedEventArgs>((s,args) =>  
                {  
                    steps++;  
                }));  
            } 

    I think this should resolve your issue. Feel free to contact us for further support.

    Best wishes,
    Hristo Borisov
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  6. andrew rekvils
    andrew rekvils avatar
    18 posts
    Member since:
    Dec 2005

    Posted 10 Apr 2009 Link to this post

    Excellent. Tnx a lot!
Back to Top
DevCraft banner