I posted yesterday about using the XamFormulaEditor in the XamDataGrid. That post was answered and allowed me to keep investigating the XamFormulaEditor. I've now seen how to add named references and custom functions to the formula editor dialog and that goes a long way to finishing up.
Now I need to know how to remove the control list from the dialog. Basically, it appears that the dialog is displaying the formula target control ("FormulaTarget" in the attached example) for each row in my grid. I'm not using the target control, and in fact it's not even visible on the form, so I'd like to just remove the control list entirely from the dialog. Is there any way to do that?
Alternatively, it appears that I can filter the Operands to the Named References that I've added. If I can't remove the control list, is there a way I can programatically apply the Operands filter and then prevent the user from changing it?
I've attached the updated project from yesterday to illustrate the issue.
Thanks,
Steve
Hello Steve,
Thank you for your post. I have been looking into it and the sample you have provided and I modified it, so now it has the functionality you want. Basically I handled the FormulaDialog Loaded event and in its handler I remove the Controls item and make the ComboBox and SearchBox disabled. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Thanks, Stefan. Can you think of any other way to do this in the main form rather than than the App.xaml.cs file? The problem is that I have a large application with many forms. I want to use the formula editor on one form this way, but its likely that I'll use the formula editor differently on another form.
I tried moving your code to a window resource on the MainWindow xaml file, but that didn't work (you probably already knew it wouldn't). I also tried adopting the code to the FormulaEditorDialogDisplaying event, but that doesn't work either. Apparently, the Utilities.GetDescendantFromName method doesn't find the controls in the DialogDisplaying event handler like it does in the Loaded event handler. Based on the objects available in the FormulaEditorDialogDisplaying event, it seems there should be some way to accomplish what I want.
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
Hello Ananthan,
It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking into it and I can suggest you see the sample from this forum thread:
http://ko.infragistics.com/community/forums/t/65646.aspx
which has the functionality you want.
Feel free to write me if you have further questions.
Hi Stefan.
We are having an issue integrating the XamFormulaEditor control with XamDataGrid control for calcuation.
I am trying to integrate the formula editing feature with my XamDataGrid control in our WPF application. The control has its AutoGenerateFields property set to false and it binds data successfully. I have a XamFormulaEditor control on the Window to allow the user build his own formula and add the result as a new field(column) into the existing XamDataGrid.I have set the Target property of the XamFormulaEditor as
Target="{Binding ElementName=xamGrid}".
Target="{Binding ElementName=xamGrid}"
I can enter the formula like "[Last4] + 2" and have my new column with correct value. The problem is that when I use the built in ContextualHelp feature by using the autocomplete suggestions and the operands list, the result goes wrong as the source column is always of Row at 0, because the formula becomes like
"[Last4] + 2"
[//dataPresenterAdapter/Table(0)/counsel_Status_Id]
Basically we need to have a FormulaEditor control that can be used to create a new Field in the XamDataGrid using CalculationManager.Do any of you have an idea that might be useful in this context?Or do you have a sample that implements the same logic?
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Thanks, Stefan. I've reviewed the project you attached and I think it does exactly what I need. Thanks again for the prompt reply.