Question

I can set a Tooltip descriptor to a field by setting a [Display(Name="My Description")] to a property in the domain service metadata.

An example is:

[Display(Description="Type can be I (Individual), S (Store)")]
public string CustomerType { get; set; }

example

But in the case of a more complex field, the tooltip descriptor doesn't show:

This is the case:

[Display(Description="The territory the customer is in")]
public SalesTerritory SalesTerritory { get; set; }

Being the corresponding field definition (SalesTerritory is bound to SelectedItem):

<toolkit:DataField Label="Territory:">
    <ComboBox DisplayMemberPath="Name"
                SelectedValuePath="TerritoryID"
                ItemsSource="{Binding Path=DataContext.SalesTerritories,
                                    RelativeSource={RelativeSource AncestorType=UserControl}}"
                SelectedItem="{Binding Path=SalesTerritory, 
                                        Mode=TwoWay}">
    </ComboBox>
</toolkit:DataField>

But the DataForm doesn't show the tooltip:

Other Example

I think that the reason it doesn't show is clear, but how can I overcome the issue?

Was it helpful?

Solution

As far as I know you should use a description viewer. DisplayAttribute is specially designed for datagrid and not all controls make us of it. Something like

<sdk:DescriptionViewer Target="{Binding ElementName=myCmbBoxName}"/>

should work

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top