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

3 posts, 0 answers
  1. vikas gupta
    vikas gupta avatar
    38 posts
    Member since:
    Nov 2009

    Posted 30 Nov 2011 Link to this post

    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

        End Sub
  2. M
    M avatar
    1 posts
    Member since:
    Apr 2014

    Posted 17 Apr 2014 Link to this post

    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);



    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());

    OK button enabled is false.

    How do you suggest I proceed? Thanks

  3. UI for WPF is Visual Studio 2017 Ready
  4. Dimitrina
    Dimitrina avatar
    3769 posts

    Posted 18 Apr 2014 Link to this post


    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.


    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.

Back to Top