Skip to main content
.NET Framework 4.6.2+

ToolTipAttribute Class

Specifies the tooltip that is displayed for the target class’ objects.

Namespace: DevExpress.Persistent.Base

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

Declaration

[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, Inherited = true, AllowMultiple = false)]
public class ToolTipAttribute :
    ModelExportedValuesAttribute

Remarks

You can specify the tooltip for your business class’ property via the ToolTipAttribute or the IModelToolTip.ToolTip property of the BOModel | <Class> | OwnMembers | <Member> node in the Model Editor.

Once set for a class member, the tooltip value is automatically calculated for all related UI elements - List View column headers, controls of Detail View items, as well as for layout groups and captions of layout items (you can customize tooltips for these elements in the Application Model as well).

You can also specify a tooltip using the ToolTip property for a navigation group or item node under the NavigationItems node in the Model Editor. This has no effect for groups in WinForms Navigation Bar with Outlook Style.

In the code below, the ToolTipAttribute is applied to the Task.Contacts property and the ToolTipAttribute.ToolTip text is specified.

public class Task : BaseObject {
    // ...
    [ToolTip("View, assign or remove contacts for the current task")]
    public virtual IList<Contact> Contacts { get; set; } = new ObservableCollection<Contact>();
    // ...
}

// Make sure that you use options.UseChangeTrackingProxies() in your DbContext settings.

The result is demonstrated below.

Windows Forms Application:

TooltipSimple_Win

ASP.NET Web Forms Application:

TooltipSimple_Web

In Windows Forms applications, additional ToolTipAttribute.ToolTipTitle and ToolTipAttribute.ToolTipIconType parameters have effect in Detail Views.

TooltipAdvanced_Win

Alternatively, you can configure tooltips in the Model Editor. For instance, this approach is useful when you cannot modify the required property implementation in code.

TooltipAdvanced_ME

You can see an example of using the ToolTipAttribute attribute in the MainDemo application that is shipped with XAF and installed to %PUBLIC%\Documents\DevExpress Demos 24.2\Components\XAF\MainDemo, by default.

Inheritance

Object
Attribute
DevExpress.Persistent.Base.ModelExportedValuesAttribute
ToolTipAttribute
See Also