Initialize ExpressionEditor with a Linq expression?

2 posts, 0 answers
  1. Lisa
    Lisa avatar
    1 posts
    Member since:
    Jul 2011

    Posted 19 Jul 2011 Link to this post

    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.

  2. Stefan Dobrev
    Stefan Dobrev avatar
    790 posts

    Posted 20 Jul 2011 Link to this post

    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!

Back to Top