show result preview

2 posts, 0 answers
  1. Wang
    Wang avatar
    46 posts
    Member since:
    Oct 2011

    Posted 08 Aug Link to this post

    hello!

    I use ExpressionEditor in a project ,the main code is: 

    xaml:

     <TextBox x:Name="aaa"/>
    <telerik:RadExpressionEditor Grid.Row="1" x:Name="ExpressionEditor"
    ExpressionChanged="ExpressionEditor_ExpressionChanged"
    ExpressionText="Sin(100)" />

     

    cs:

    private void ExpressionEditor_ExpressionChanged(object sender, RadRoutedEventArgs e)
            {
                try
                {
                    dynamic dynamicExpression = ExpressionEditor.Expression;
                    dynamic compiledExpression = dynamicExpression.Compile();
                    object executionResult = compiledExpression();
                    aaa.Text = executionResult.ToString();
                }
                catch
                {

                }
                
            }

     

    the TextBox can show the result,but result preview of the RadExpressionEditor did not show the result,why? what should I do?

    by the way,can we improve the RadExpressionEditor to make the programmer can  add custorm function or constants like Pi?

  2. Wang
    Wang avatar
    46 posts
    Member since:
    Oct 2011

    Posted 08 Aug Link to this post

    I solved the first problem by set the item property,thank you.

    so can we improve the RadExpressionEditor to make the programmer can  add custorm function or constants like Pi?

Back to Top