Unplanned
Last Updated: 16 Jul 2026 13:04 by ADMIN
Wojtek
Created on: 16 Jul 2026 13:03
Category: DataGrid
Type: Feature Request
0
DataGrid: Request for MouseHover Style Selector
I'd appreciate proper selector for this. I think that's a good addition for DataGrid customization having a style selector for the mouse hover based on the cell value
1 comment
ADMIN
Didi
Posted on: 16 Jul 2026 13:04
Solution:
   grid.VisualStateService.PropertyChanged += (s, e) =>
        {
            if (e.PropertyName != nameof(grid.VisualStateService.MouseHoverCell))
                return;

            var cell = grid.VisualStateService.MouseHoverCell;
            var model = cell?.Item as SomeModel;

            grid.MouseHoverStyle = new Style(typeof(DataGridMouseHoverAppearance))
            {
                Setters =
                {
                    new Setter
                    {
                        Property = DataGridBorderAppearance.BackgroundColorProperty,
                        Value = model.HasFutureAppointments || model.SomeOtherProperty.HasFutureAppointments 
                            ? Colors.Blue
                            : Colors.Red
                    }
                }
            };
        };

Regards,
Didi
Progress Telerik