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

how can i handle ok and cancel button click event of the expression editor

2 Answers 84 Views
ExpressionEditor
This is a migrated thread and some comments may be shown as answers.
vikas gupta
Top achievements
Rank 1
vikas gupta asked on 30 Nov 2011, 07:11 AM
i set two way binding then on ok is working fine,cancel is not
and if i set one way binding cancel is working fine ok button is not

i am calling expression editor on a button click dynamically that code is:
  Private Sub btnRiskFactorFormular_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
        Dim window As New ExpressionEditorWindow()
        window.DataContext = DirectCast(sender, System.Windows.Controls.Button).DataContext
        Dim bindFormular As System.Windows.Data.Binding = New System.Windows.Data.Binding("ewrf_formula")
        ' bindFormular.Mode = BindingMode.OneWay
        window.ExpressionEditor.SetBinding(RadExpressionEditor.ExpressionTextProperty, bindFormular)
        Dim objRiskFactors As New WellnessIncentiveMethods
        Dim test As List(Of EERiskFactorFields) = objRiskFactors.fnGetRiskFactorNames()
        window.ExpressionEditor.Item = test(0)
        AddHandler window.Closed, AddressOf Me.OnExpressionWindowClosed
        window.ShowDialog()


    End Sub

2 Answers, 1 is accepted

Sort by
0
M
Top achievements
Rank 1
answered on 18 Apr 2014, 02:35 AM
I have a similar scenario where the OK button is enabled in the Ui but it is disabled & hence the click method doesn't execute at run time.

var window = GetWindowRecursive("Windows Security");

Assert.IsFalse(window.Equals(null), "Window with caption 'Windows Security' was not found.");

Button okButton = new ArtOfTest.WebAii.Win32.Button(window.Handle, "Ok", true);
Button cancelButton = new ArtOfTest.WebAii.Win32.Button(window.Handle, "Cancel", true);

okButton.SetActive();
okButton.Show();

cancelButton.SetActive();
cancelButton.Show();

Console.WriteLine("OK button exists? {0}", okButton.Exists.ToString());
Console.WriteLine("OK button is enabled? {0}", okButton.Enabled.ToString());
Console.WriteLine("OK button is visible? {0}", okButton.IsVisible.ToString());

Console.WriteLine("Cancel button exists? {0}", cancelButton.Exists.ToString());
Console.WriteLine("Cancel button is enabled? {0}", cancelButton.Enabled.ToString());
Console.WriteLine("Cancel button is visible? {0}", cancelButton.IsVisible.ToString());

Result:
OK button enabled is false.

How do you suggest I proceed? Thanks

0
Dimitrina
Telerik team
answered on 18 Apr 2014, 01:47 PM
Hi,

Have you followed the Expression Editor (First Look) example on our WPF Demos? I tested on it, and both the buttons (OK and Cancel) worked fine.

Regards,
Didie
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
ExpressionEditor
Asked by
vikas gupta
Top achievements
Rank 1
Answers by
M
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or