We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Edit cell while mouse over

I've used standard datagrid and I used this way:

     <Style TargetType="{x:Type DataGridCell}">
               <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="IsEditing" Value="True" />

How to get a similar effect using SfDataGrid? 

4 Replies

SV Srinivasan Vasu Syncfusion Team June 28, 2017 09:20 AM UTC

Hi Rafal, 
Thanks for contacting Syncfusion support. 
We have checked your query and you can achieve the requirement by overriding the GridSelectionController. In sample, we have called the BeginEdit method for editing respective GridCell. 
Please refer the below code 
  this.datagrid.SelectionController = new SelectionControllers(this.datagrid); 
   public class SelectionControllers : GridSelectionController 
        public SelectionControllers(SfDataGrid dataGrid) : base(dataGrid) 
        protected override void ProcessPointerMoved(MouseEventArgs args, RowColumnIndex rowColumnIndex) 
            base.ProcessPointerMoved(args, rowColumnIndex); 
            if (rowColumnIndex.ColumnIndex == 2) 
                this.DataGrid.SelectionController.MoveCurrentCell(new RowColumnIndex(rowColumnIndex.RowIndex,rowColumnIndex.ColumnIndex)); 
Please download the sample from the below location. 

SV Srinivasan Vasu Syncfusion Team June 28, 2017 09:35 AM UTC

Hi Rafal, 
Sorry for inconvenience. 
Please download the sample here: 

RA Rafal June 29, 2017 09:09 AM UTC

Hello Srinivasan,
thank you for Sample but it generate some problems. 

For examples, I can't select one row, then move mouse pointer to interesting cell without changing selection.

I've modified your example to show problem:


Look at my Video sample with std DataGrid:


SV Srinivasan Vasu Syncfusion Team July 1, 2017 04:37 PM UTC

Hi Rafal, 
We have checked your query and we have moved the Selection based on currentcell of SfDataGrid. In sample, we have move the currentcell and invoke BeginEdit method to bring the edit mode while mouse move on SfDataGrid. So, that the selection moved to corresponding datarow based on currentcell. 
In sample, you have set AllowRowHoverHighlighting as true to show the Hovers of Highlighting rows. This is the default behavior in our side. 

Live Chat Icon For mobile
Up arrow icon