Articles in this section
Category / Section

How to show tooltip on the disabled cell in WPF DataGrid?

2 mins read

In WPF DataGrid (SfDataGrid) , you can show tooltip for the disabled GridCell by writing style and enabling ToolTipService.ShowOnDisabled.

<syncfusion:SfDataGrid x:Name="dataGrid"
                       AutoGenerateColumns="False"
                       ItemsSource="{Binding Path=OrdersDetails}"
                       ColumnSizer="Auto"
                       ShowToolTip="true">
            
      <syncfusion:SfDataGrid.Columns>
           <syncfusion:GridTextColumn MappingName="OrderID" />
           <syncfusion:GridTextColumn MappingName="CustomerID" />
           <syncfusion:GridTextColumn MappingName="ShipCountry" >
              <syncfusion:GridTextColumn.CellStyle>
                  <Style TargetType="syncfusion:GridCell" >
                       <Setter Property="IsEnabled" Value="False" />
                       <Setter Property="ToolTip" >
                            <Setter.Value>
                                 <TextBlock Text="{Binding ShipCountry}" 
                                            Foreground="Red" 
                                            ToolTipService.IsEnabled="True" 
                                            ToolTipService.ShowOnDisabled="True"/>
                             </Setter.Value>
                        </Setter>
                        <Setter Property="ToolTipService.IsEnabled" Value="True" />
                        <Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
                  </Style>
              </syncfusion:GridTextColumn.CellStyle>
           </syncfusion:GridTextColumn>           
           <syncfusion:GridTextColumn MappingName="Freight" />
           <syncfusion:GridCheckBoxColumn HeaderText="Closed"
                                          MappingName="IsClosed" />
      </syncfusion:SfDataGrid.Columns>
</syncfusion:SfDataGrid>
 Show tooltip for disabled cell


Take a moment to peruse the WPF DataGrid - ToolTip documentation, to learn more about tooltip with examples.


View sample in GitHub

Conclusion

I hope you enjoyed learning about how to show tooltip on the disabled cell in DataGrid.

You can refer to our WPF DataGrid feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WPF DataGrid example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!
Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied