-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #908 from telerik/didi/hover-cell
Add Hover cell
- Loading branch information
Showing
4 changed files
with
46 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
title: Mouse Hover Cell | ||
page_title: .NET MAUI DataGrid Documentation - Hover Cell | ||
description: Learn how to get the current hovered cell and style the appearance of the cell of the Telerik UI for .NET MAUI DataGrid component. | ||
position: 2 | ||
slug: datagrid-mouse-hover-cell | ||
--- | ||
|
||
# .NET MAUI DataGrid Hover Cell | ||
|
||
The [Telerik UI for .NET MAUI DataGrid]({%slug datagrid-overview%}) provides option to get the data of the cell that the mouse is currently over. In addition, you can change the default hover style. The feature is available only on Desktop - `WinUI` and `MacCatalyst`. | ||
|
||
## Getting the Hovered Cell | ||
|
||
The DataGrid provides a `VisualStateService` property (of type `DataGridVisualStateService`). This property gets the service that handles visual-state related logic, such as keeping track of the element that the mouse is currently over. | ||
|
||
The `DataGridVisualStateService` class encapsulates visual state related logic such as mouse-hovered elements within a `Telerik.Maui.Controls.RadDataGrid` instance. This class exposes the `MouseHoverCell` property (`DataGridCellInfo`) which allows you to get the cell that the mouse is currently over. | ||
|
||
Here is an example how to get the hovered cell. | ||
|
||
```C# | ||
var hoveredCell = dataGrid.VisualStateService.MouseHoverCell; | ||
``` | ||
|
||
## Styling the Cell | ||
|
||
You can specify the style for the cells and rows when the mouse is over by using the `MouseHoverStyle` property (of type `DataGridBorderStyle`) and applying the `BackgroundColor`, `BorderColor`, and `BorderThickness` properties. | ||
|
||
## See Also | ||
|
||
- [Setting the .NET MAUI DataGrid Columns]({%slug datagrid-columns-overview%}) | ||
- [Grouping in the DataGrid]({%slug datagrid-grouping-overview%}) | ||
- [Using the DataGrid Commands]({%slug datagrid-aggregates%}) | ||
- [Sorting .NET MAUI DataGrid Records]({%slug datagrid-sorting-overview%}) | ||
- [Filtering .NET MAUI DataGrid Records]({%slug datagrid-filtering-overview%}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters