Hi,
I have the code:
foreach(Field field in obj.Fields)
{
Infragistics.Calculations.NamedReference reference = new Infragistics.Calculations.NamedReference() { ReferenceId = field.Name, Category = "Data Fields" };
ControlCalculationSettings calcSettings = new ControlCalculationSettings();
calcSettings.ReferenceId = field.Name;
calcSettings.TreatAsType =typeof(double);
_calculationManager.NamedReferences.Add(reference);
}
The code adds new ReferenceId under the Name Reference Category.
I was wondering if I can create my own category called "Custom" instead of Named References or Controls and add everything under that category?
Thanks,
That is currently not supported. You can change the name of the "Named References" category by registering a new value for the "Operand_Category_NamedReferences" resource string, but you cannot add new nodes which are siblings to the "Named References" or "Controls" nodes. I have forwarded this post to the Developer Support Manager to create a feature request on your behalf.
can you please create an example for me how to replace the name of the "Named References" category with something else.
--Andrei
thank you that help alot. I am able to hide the controls category by doing this:
(xdt.ItemsSource as FilteredCollection<OperandInfo>).ApplyFilter(t => t.Name != "Controls");
I am wondering if it's a way to hide the "All" category under the Named References?
Thank you!
Actually, I don't think that is a good way to hide the Controls category. As soon as the user types into the search field, your filter is going to be replaced with a filter which only shows items meeting the search criteria. Again, this is currently not supported. The calculation manager has a predefined structure it populates in the formula editor dialog's operands tree. We would need to support having a custom structure for you to accomplish what you are looking to do.
I have an additional question about the XamFormulaEditor. In the
XamFormulaEditor_FormulaEditorDialogClosing event I want to detect if the user clicked "OK" or "Cancel". Is that possible?
There is no way to detect this from that event. I have forwarded this post to the Developer Support Manager to create a feature request on your behalf.
What you might be able to do is create your own FormulaEditorDialog instance and call its DisplayAsDialog method. The closedCallback parameter of that method is an action delegate which gets passed a nullable boolean. If the Ok button was pressed, the value will be True, if the Cancel button was pressed, the value will be False, and if the dialog is closed for any other reason, the value is will be null.
can you please create a small example for me.
Hello Andrei,
Thank you for your post. I have been looking into your discussion with Mike and I have created a sample application for you, which shows how you can create your custom XamFormulaEditor and FormulaEditorDialog by creating classes that derives from them. In the custom XamFormulaEditor class, I have created two custom events: FormulaEditorDialogExClosing and FormulaEditorDialogExClosed
, in which you can detect the source of the closing, by checking the ClosedReason property of the event args.
Please let me know if you need any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
I have also submitted a new Product Idea for you, for having the ability to detect the clicked button in the FormulaEditorDialogClosing evnet. I have sent your Product Idea directly to our product management team. Our product team chooses new Product Ideas for development based on popular feedback from our customer base. Infragistics continues to monitor application development for all of our products, so as trends appear in requested ideas, we can plan accordingly.
We value your input, and our philosophy is to enhance our toolset based on customer feedback. If your idea is chosen for development, you will be notified at that time. Your reference number for this Product Idea is PI12110160
If you would like to follow up on your Product Idea at a later point, you may contact Developer Support management via email. Please include the reference number of your Product Idea in the subject and body of your email message. You can reach Developer Support management through the following email address: dsmanager@infragistics.com
Thank you for your request.
I am just checking if you require any further assistance on the matter.