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

show result preview

1 Answer 65 Views
ExpressionEditor
This is a migrated thread and some comments may be shown as answers.
Wang
Top achievements
Rank 1
Wang asked on 08 Aug 2017, 09:50 AM

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?

1 Answer, 1 is accepted

Sort by
0
Wang
Top achievements
Rank 1
answered on 09 Aug 2017, 01:19 AM

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?

Tags
ExpressionEditor
Asked by
Wang
Top achievements
Rank 1
Answers by
Wang
Top achievements
Rank 1
Share this question
or