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

RadWindow.Confirm() - passing an object

4 Answers 286 Views
Window
This is a migrated thread and some comments may be shown as answers.
GEB
Top achievements
Rank 1
GEB asked on 28 Jan 2009, 06:55 PM
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.

4 Answers, 1 is accepted

Sort by
0
Hristo Borisov
Telerik team
answered on 29 Jan 2009, 10:25 PM
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.
0
andrew rekvils
Top achievements
Rank 1
answered on 08 Apr 2009, 06:53 PM

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

0
Hristo Borisov
Telerik team
answered on 09 Apr 2009, 09:01 AM
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.
0
andrew rekvils
Top achievements
Rank 1
answered on 10 Apr 2009, 12:43 PM
Excellent. Tnx a lot!
Tags
Window
Asked by
GEB
Top achievements
Rank 1
Answers by
Hristo Borisov
Telerik team
andrew rekvils
Top achievements
Rank 1
Share this question
or