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

Messagebox Yes/No before changing switch the Toggle

1 Answer 132 Views
New Product Suggestions
This is a migrated thread and some comments may be shown as answers.
Mehdi
Top achievements
Rank 1
Mehdi asked on 07 Jul 2019, 05:21 PM

hi all

i want to send a question to user "are u sure to switch off?" when user click on slide the toggle switcher.

how can do this?

set the snipped code in valueChanging action, but if user click on "No", the toggle switch to off!

 

if (switchtg.Value)
                {
                    RadMessageBox.Instance.StartPosition = FormStartPosition.CenterParent;
                    if (RadMessageBox.Show("Are u sure ?", "disconnecting...", MessageBoxButtons.YesNo,
                            RadMessageIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                    {
                        //_allowdc = true;
                        switchtg.Value = true;
                        //switchtg.ValueChanged -= switchtg_ValueChanged;
                    }
                    else
                    {
                       // _allowdc = false;
                        switchtg.Value = false;
                        //switchtg.ValueChanged -= switchtg_ValueChanged;
 
                    }
 
                }

1 Answer, 1 is accepted

Sort by
0
Mehdi
Top achievements
Rank 1
answered on 07 Jul 2019, 05:29 PM

i'm so sorry, found the solution.

use=> e.cancle = true 

problem fixed.

 

Tags
New Product Suggestions
Asked by
Mehdi
Top achievements
Rank 1
Answers by
Mehdi
Top achievements
Rank 1
Share this question
or