[RESOLVED] WPF - DataGrid - Tooltip for individual items
FYI: I'm VERY new to WPF, so forgive me asking questions the wrong way....(or posting too much code)
Got an existing DataGrid in a form (actually a popup)
Code:
<DataGrid x:Name="itemsListBox" HeadersVisibility="None"
VerticalGridLinesBrush="Transparent"
HorizontalGridLinesBrush="Transparent"
Grid.Row="6"
MinHeight="45"
MaxHeight="107.31"
CanUserAddRows="False"
CanUserDeleteRows="False"
CanUserReorderColumns="False"
CanUserResizeColumns="False"
CanUserResizeRows="False"
AutoGenerateColumns="False"
Margin="8,4,8,4"
ItemsSource="{Binding Items.ItemsDetailsList}"
Background="Transparent"
HorizontalScrollBarVisibility="Disabled"
Style="{DynamicResource PopUpGrid}"
SelectedItem="{Binding SelectedItemDetail, Mode=TwoWay}"
BorderBrush="{x:Null}"
>
Now I was asked that if the individual items in the list are too long (> 5 words) to "cut it off" with a "..." and display a tooltip when the user hover over the item.
A push in the right direction?
Re: WPF - DataGrid - Tooltip for individual items
Seems one uses ToolTipService.ToolTip="{Binding ...
Now I just got to figure out what that binding should be....
Re: [RESOLVED] WPF - DataGrid - Tooltip for individual items
I've been working on something very similar lately. Just to note, if you only want the ToolTip when the text in the grid cell is cut off... well, it's not quite just that simple :)
I've got a custom control derived from TextBlock that exposes an additional DP for whether the Text as displayed is trimmed. I'm using this in a trigger to set the ToolTip only when the text is trimmed.