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

Initialize ExpressionEditor with a Linq expression?

1 Answer 135 Views
ExpressionEditor
This is a migrated thread and some comments may be shown as answers.
Lisa
Top achievements
Rank 1
Lisa asked on 19 Jul 2011, 05:53 PM

I am looking at using the ExpressionEditor to allow the user to add custom calculated columns - and I would like the user to be able to edit the expression afterwards.

What I would like to do is:
GridViewExpressionColumn col = (GridViewExpressionColumn)this.GridView.Columns[activeColumnName];  

window.ExpressionEditor.Expression = col.Expression;

but of course ExpressionEditor.Expression is read only; and col.Expression.ToString() does not return the right format. Is there a way to do this directly, or do I have to do something like maintain a separate dictionary of expression text?

Also - is the documentation for ExpressionEditor available yet? There are posts from a while back saying it will be available soon, but I do not see it.

1 Answer, 1 is accepted

Sort by
0
Stefan Dobrev
Telerik team
answered on 20 Jul 2011, 06:27 AM
Hi Lisa,

You can look at this online example which illustrates how this can be achieved. Also I should note that Expression property of GridViewExpressionColumn has a type converter applied which can convert strings to expressions. This means that you can use strings to store the expressions and feed both the column and the expression editor with them.

Here is the link to our online documentation about RadExpressionEditor.

Hope this helps,
Stefan Dobrev
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
ExpressionEditor
Asked by
Lisa
Top achievements
Rank 1
Answers by
Stefan Dobrev
Telerik team
Share this question
or