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.