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

Expression Evaluation Event

5 Answers 104 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Miguel
Top achievements
Rank 1
Miguel asked on 17 May 2016, 03:27 PM

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.

 

 

5 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 18 May 2016, 11:32 AM
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.
0
Miguel
Top achievements
Rank 1
answered on 24 May 2016, 12:21 PM

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.

 

0
Dimitar
Telerik team
answered on 25 May 2016, 08:45 AM
Hello Miguel,

Thank you for writing back.

This code gets an embedded resource. In your case, you can load the  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.
0
Miguel
Top achievements
Rank 1
answered on 25 May 2016, 01:26 PM

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?

0
Accepted
Dimitar
Telerik team
answered on 26 May 2016, 07:32 AM
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.
Tags
GridView
Asked by
Miguel
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Miguel
Top achievements
Rank 1
Share this question
or