Home Forums WPF controls Xceed DataGrid for WPF Custom ToolTip for DataRow

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #24043 |

    I am building a DataGrid from an observable collection, and I would like to display a StackPanel (for example) with information pulled out of Cells/Fields in a DataRow as that Data Row’s ToolTip. How do I assign the StackPanel to the DataRow’s ToolTip property? I have tried using a Style but I get an error:
    Cannot add content of type StackPanel to an object of type ‘System.Object’

    how else could i set the tooltip? i basically want to display a panel with a summary of the datarow’s values (b/c the row is very long and i wish to keep all the fields visible for scrolling through) as its tool tip.

    Imported from legacy forums. Posted by Michael (had 3434 views)

    User (Old forums)
    Member
    Post count: 23064

    <Nudge>

    Imported from legacy forums. Posted by Jeff (had 1083 views)

    Xceed Support
    Member
    Post count: 5658

    Create the ToolTip as a resource and then set that ToolTip resource via the style, as such:

    <ToolTip x:Key=”myToolTip”>

          <StackPanel>

              <Button Content=”asdasd” />

              <TextBlock Text=”sdkjsklfjsdf” />

          </StackPanel>

      </ToolTip>

      <Style TargetType=”{x:Type xcdg:DataCell}”>

          <Setter Property=”ToolTip”

                  Value=”{StaticResource myToolTip}” />

      </Style>

    This seems to be a limitation of the XAML parser and is not related to the grid (you will encounter the same exception if you target Button rather than DataCell).

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

    User (Old forums)
    Member
    Post count: 23064

    How can i include the data from a hidden field in a datarow as the body of a textblock in a tooltip for that datarow?

     thanks

    Imported from legacy forums. Posted by Alan (had 920 views)

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