RadExpressionEditor parsing functionality

2 posts, 0 answers
  1. Nedeltcho
    Nedeltcho avatar
    3 posts
    Member since:
    Sep 2012

    Posted 13 Sep 2012 Link to this post

    Hello,

    we're using your RadExpression editor in our application. We create the expressions using the editor and then we save them. At a
    later stage we parse them using the editor again, but we would like to use the parsing functionality without a dependence on WPF.
    Is there anyway to do that with any of your products?


    public static List<T> Filter<T>(IList<T> items, string filter) where T : new()
            {
                var result = new List<T>();
     
                try
                {
                    var editor = new RadExpressionEditor();
                    editor.Item = new T();
                    Expression exprResult;
                    var isSuccess = editor.TryParse(filter, out exprResult);
     
                    if (isSuccess)
                    {
                        var expr1 = (Expression<Func<T, bool>>)exprResult;
                        var func = expr1.Compile();
                        result = items.Where(func).ToList();
                    }
                }
                catch (Exception)
                {
                    
                }
     
                return result;
            }
    regards,
    Ned Stoyanov
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 13 Sep 2012 Link to this post

    Hello Ned,

    Unfortunately you cannot parse functionality without a dependence on WPF. 

    Regards,
    Didie
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top