Support ID T169661 explains how to enable tooltips for the ActiveListBox of CustomizationForm. In a XAF application, the Add… button of CustomizationForm invokes a popup window with a caption of Object Model. How do we activate tooltips in that popup too? Thanks.
We have closed this ticket because another page addresses its subject:
WinForms - It is difficult to distinguish between fields with the same name in Customization FormsTooltips in Object Model Popup of CustomizationForm
Answers approved by DevExpress Support
Thank you for contacting us.
I have investigated your scenario and introduced necessary changes to our code to make it work.
Now, you can implement it in the following way:
C#public class Controller1 : ViewController {
ColumnChooserControllerBase columnChooserControllerBase;
GridEditorColumnChooserController gridEditorColumnChooserController;
private void ColumnChooserControllerBase_ColumnChooserExtenderChanged(object sender, ColumnChooserExtenderChangedEventArgs e) {
if(e.Extender != null) {
e.Extender.ModelBrowserCreated += Extender_ModelBrowserCreated;
}
}
private void Extender_ModelBrowserCreated(object sender, DevExpress.ExpressApp.Win.Editors.ModelBrowserCreatedEventArgs e) {
ToolTipController toolTipController = new ToolTipController();
e.ModelBrowser.FieldsTreeList.ToolTipController = toolTipController;
toolTipController.GetActiveObjectInfo += ToolTipController_GetActiveObjectInfo;
}
private void ToolTipController_GetActiveObjectInfo(object sender, ToolTipControllerGetActiveObjectInfoEventArgs e) {
if(e.SelectedControl is DevExpress.XtraTreeList.TreeList) {
TreeList tree = (TreeList)e.SelectedControl;
TreeListHitInfo hit = tree.CalcHitInfo(e.ControlMousePosition);
if(hit.HitInfoType == HitInfoType.Cell) {
object cellInfo = new TreeListCellToolTipInfo(hit.Node, hit.Column, null);
string toolTip = string.Format("{0} (Column: {1}, Node ID: {2})", hit.Node[hit.Column], hit.Column.FieldName, hit.Node.Id);
e.Info = new DevExpress.Utils.ToolTipControlInfo(cellInfo, toolTip);
}
}
}
protected override void OnActivated() {
base.OnActivated();
columnChooserControllerBase = Frame.GetController<ColumnChooserControllerBase>();
if(columnChooserControllerBase != null) {
columnChooserControllerBase.ColumnChooserExtenderChanged += ColumnChooserControllerBase_ColumnChooserExtenderChanged;
}
gridEditorColumnChooserController = Frame.GetController<GridEditorColumnChooserController>();
if(gridEditorColumnChooserController != null) {
gridEditorColumnChooserController.ColumnChooserExtenderChanged += ColumnChooserControllerBase_ColumnChooserExtenderChanged;
}
}
protected override void OnDeactivated() {
if(columnChooserControllerBase != null) {
columnChooserControllerBase.ColumnChooserExtenderChanged -= ColumnChooserControllerBase_ColumnChooserExtenderChanged;
columnChooserControllerBase = null;
}
gridEditorColumnChooserController = Frame.GetController<GridEditorColumnChooserController>();
if(gridEditorColumnChooserController != null) {
gridEditorColumnChooserController.ColumnChooserExtenderChanged -= ColumnChooserControllerBase_ColumnChooserExtenderChanged;
gridEditorColumnChooserController = null;
}
base.OnDeactivated();
}
}
See the attached project for a complete solution.
This change will be included into the next minor update for v16.1, v16.2 and v17.1 releases.
See also:
- How to customize the ToolTip for a TreeList cell
- Customize Controllers and Actions
We have published a daily build containing this functionality. You can download it from the link below:
DevExpressNETComponents-17.1.4.17185.exe / DevExpressComponents-16.2.8.17185.exe
To confirm, with XAF 18.1.3, tooltips now appear in the model browser using the above controller. This is very helpful for our users. Thanks again.
Currently, there is no easy way to accomplish your task. Please describe your scenario in greater detail: what information you want to show in these tooltips and why your users need it.
The rationale for showing tooltips in the Object Model popup is exactly the same as for showing tooltips in the ActiveListBox. It is to guide users when selecting a new column to add to the grid.
Our XAF application is multilingual. It supports English, Japanese and other languages. When the application runs in English we use tooltips to show the Japanese equivalent term. Vice-versa when the application runs in Japanese. We use ResourceManager to fetch the culture-specific terms.
What is special about the Object Model popup that makes it difficult to support tooltips?
Hello Michael,
Thank you for describing your scenario. It is clear to our team and we will take it into account as we plan for the future. Technically, it should not be difficult to provide tooltips for any custom control. It is just difficult to expose the internal ModelBrowser component to allow customers to customize it (without modifying the XAF source code) as this customization was not planned from the beginning. Regardless, we will see how to best approach this.
Thanks Dennis and Anatol for investigating this request.
Hi Dennis and Anatol. Curious to know if the ModelBrowser component has been updated to enable tooltip support ?
Hello Michael,
We have not touched this internal and undocumented ModelBrowser component so far and also have not planned tooltip support in it for any specific release.
Internally, this class uses the DevExpress TreeList control for which you can use standard approaches available in its demos, examples, and online documentation. For instance: How to customize the ToolTip for a TreeList cell.
I will update you soon if we can easily provide access to this TreeList instance for you so that you will be able to implement custom features you wanted on your own side. Thanks.
Thanks Dennis.