Home Forums WPF controls Xceed DataGrid for WPF Row ToolTip

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • Xceed Support
    Member
    Post count: 5658
    #24300 |

    Hi,

    with WPF you can do almost anything, that is absolutly great. But it adds a bit a complexity.
    What I’m trying to do, to have a UserControl in a Row ToolTip, depending on the row, the information passed to the UserControl will change. I was wandering how to access the DataRow’s ToolTip.

    Thanks in advance.

    Imported from legacy forums. Posted by Simon (had 646 views)

    Xceed Support
    Member
    Post count: 5658

    Create a DataRow style in which you set the ToolTip property.

    Next, create a ToolTip style in which you provide a new ControlTemplate that will contain the control that displays the information you want.

    For example:

    <code>
    <Style TargetType=”{x:Type xcdg:DataRow}”>
    <Setter Property=”ToolTip” Value=”{Binding [ShipCountry]}”/>
    </Style>
    </code>

    <code>
    <xcdg:DataGridControl x:Name=”OrdersGrid”
    EditTriggers=”None”
    ItemsSource=”{Binding Source={StaticResource cvs_orders}}”>
    <xcdg:DataGridControl.Resources>
    <Style TargetType=”{x:Type ToolTip}”>
    <Setter Property=”Template”>
    <Setter.Value>
    <ControlTemplate>
    <Border BorderBrush=”HotPink”
    BorderThickness=”1, 1, 1,1″>
    <ContentPresenter Content=”{TemplateBinding ToolTip.Content}”/>
    </Border>
    </ControlTemplate>
    </Setter.Value>
    </Setter>
    </Style>
    </xcdg:DataGridControl.Resources>

    </xcdg:DataGridControl>
    </code>

    Imported from legacy forums. Posted by Jenny [Xceed] (had 2842 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.