Skip to content

Commit ca9b3dd

Browse files
Update README.md
1 parent eb0d9a2 commit ca9b3dd

File tree

1 file changed

+36
-4
lines changed

1 file changed

+36
-4
lines changed

README.md

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,39 @@
1-
# How to show tooltip on the disabled cell in WPF DataGrid (SfDataGrid)?
1+
# How to show tooltip on the disabled cell in WPF DataGrid?
22

3-
This example illustrates how to show tooltip on the disabled cell in [WPF DataGrid](https://www.syncfusion.com/wpf-ui-controls/datagrid) (SfDataGrid).
3+
in [WPF DataGrid](https://www.syncfusion.com/wpf-ui-controls/datagrid) (SfDataGrid), you can show tooltip for the disabled [GridCell](http://help.syncfusion.com/cr/cref_files/wpf/Syncfusion.SfGrid.WPF~Syncfusion.UI.Xaml.Grid.GridCell.html) by writing style and enabling [ToolTipService.ShowOnDisabled](https://docs.microsoft.com/en-us/dotnet/api/system.windows.controls.tooltipservice.showondisabled?view=netframework-4.7.2).
44

5-
You can show tooltip for the disabled [GridCell](http://help.syncfusion.com/cr/cref_files/wpf/Syncfusion.SfGrid.WPF~Syncfusion.UI.Xaml.Grid.GridCell.html) in [WPF DataGrid](https://www.syncfusion.com/wpf-ui-controls/datagrid) (SfDataGrid) by writing style and enabling [ToolTipService.ShowOnDisabled](https://docs.microsoft.com/en-us/dotnet/api/system.windows.controls.tooltipservice.showondisabled?view=netframework-4.7.2).
5+
```xml
6+
<syncfusion:SfDataGrid x:Name="dataGrid"
7+
AutoGenerateColumns="False"
8+
ItemsSource="{Binding Path=OrdersDetails}"
9+
ColumnSizer="Auto"
10+
ShowToolTip="true">
11+
12+
<syncfusion:SfDataGrid.Columns>
13+
<syncfusion:GridTextColumn MappingName="OrderID" />
14+
<syncfusion:GridTextColumn MappingName="CustomerID" />
15+
<syncfusion:GridTextColumn MappingName="ShipCountry" >
16+
<syncfusion:GridTextColumn.CellStyle>
17+
<Style TargetType="syncfusion:GridCell" >
18+
<Setter Property="IsEnabled" Value="False" />
19+
<Setter Property="ToolTip" >
20+
<Setter.Value>
21+
<TextBlock Text="{Binding ShipCountry}"
22+
Foreground="Red"
23+
ToolTipService.IsEnabled="True"
24+
ToolTipService.ShowOnDisabled="True"/>
25+
</Setter.Value>
26+
</Setter>
27+
<Setter Property="ToolTipService.IsEnabled" Value="True" />
28+
<Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
29+
</Style>
30+
</syncfusion:GridTextColumn.CellStyle>
31+
</syncfusion:GridTextColumn>
32+
<syncfusion:GridTextColumn MappingName="Freight" />
33+
<syncfusion:GridCheckBoxColumn HeaderText="Closed"
34+
MappingName="IsClosed" />
35+
</syncfusion:SfDataGrid.Columns>
36+
</syncfusion:SfDataGrid>
37+
```
638

7-
KB article - [How to show tooltip on the disabled cell in WPF DataGrid (SfDataGrid)?](https://www.syncfusion.com/kb/9758/how-to-show-tooltip-on-the-disabled-cell-in-wpf-datagrid-sfdatagrid)
39+
Take a moment to peruse the [WPF DataGrid - ToolTip](https://help.syncfusion.com/wpf/datagrid/tooltip) documentation, to learn more about tooltip with examples.

0 commit comments

Comments
 (0)