Skip to content

SyncfusionExamples/how-to-show-tooltip-on-the-disabled-cell-in-wpf-datagrid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

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

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>

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

About

This example illustrates how to show tooltip on the disabled cell in wpf datagrid

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 10

Languages