Expression Evaluation Event

6 posts, 0 answers
  1. Miguel
    Miguel avatar
    6 posts
    Member since:
    Mar 2011

    Posted 17 May Link to this post

    Hi Telerik Team,

    Does the evaluation of an expression in a column generates an Event? Or is there a way to intercept the evaluation process and
    substitute/enhance with my own code?

    The expressions that I need to use require data points that are not found in the dataset used in the GridView, so I need a way to
    intercept the evaluation to swap string variables that are not in the dataset with the actual value found within the application or a different dataset.

    Regards.

     

     

  2. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 18 May Link to this post

    Hello Miguel,

    Thank you for writing.

    The following article shows you can create a custom function that can be used in the expression: Customizing RadExpressionEditor.

    Another approach would be to use the CellFomatting event and change the cells text: Formatting Cells.

    Please let me know if there is something else I can help you with. 
     
    Regards,
    Dimitar
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Miguel
    Miguel avatar
    6 posts
    Member since:
    Mar 2011

    Posted 24 May Link to this post

    Thanks, I did resolved the part of doing my own functions but the second part I have not been able to complete,

    Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(path);

    always return null, so my functions are not being recognized by the expression editor.

     

  5. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 25 May Link to this post

    Hello Miguel,

    Thank you for writing back.

    This code gets an embedded resource. In your case, you can load the xml file directly. For example:
    RadExpressionEditorForm.ExpressionItemsList.LoadFromXML(@"..\..\ExpressionItemsListData.xml");

    Let me know if I can assist you further.

    Regards,
    Dimitar
    Telerik
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
  6. Miguel
    Miguel avatar
    6 posts
    Member since:
    Mar 2011

    Posted 25 May in reply to Dimitar Link to this post

    Hi Dimitar, I was able to load my own XML file, but the side effect is that

    the expression editor now only shows the 3 functions that I created, all the built in operators, functions, etc are gone.

    Is there a way to add my functions without wiping out the built in definitions?

  7. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 26 May Link to this post

    Hello Miguel,

    Thank you for writing back.

    You need to add the description for the other functions as well. I have attached the complete file that you need to load. 

    I hope this will be useful. 

    Regards,
    Dimitar
    Telerik
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
Back to Top
UI for WinForms is Visual Studio 2017 Ready