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.
Unfortunately, activation email could not send to your email. Please try again.

Edit cell while mouse over

Thread ID:

Created:

Updated:

Platform:

Replies:

131192 Jun 27,2017 11:47 AM Jul 1,2017 12:37 PM WPF 4
loading
Tags: SfDataGrid
Rafal
Asked On June 27, 2017 11:47 AM

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

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

How to get a similar effect using SfDataGrid? 

Srinivasan Vasu [Syncfusion]
Replied On June 28, 2017 05:20 AM

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)); 
 
                this.DataGrid.SelectionController.CurrentCellManager.BeginEdit(); 
            }             
        } 
    } 
 
 
Please download the sample from the below location. 
 
 
 
Regards, 
Srinivasan 


Srinivasan Vasu [Syncfusion]
Replied On June 28, 2017 05:35 AM

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


Rafal
Replied On June 29, 2017 05:09 AM

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:

https://drive.google.com/file/d/0B_dqnXZHa3PHbVNHczdlakhhbXc/view?usp=sharing


Look at my Video sample with std DataGrid:

https://youtu.be/K6QCULCROZk


Srinivasan Vasu [Syncfusion]
Replied On July 1, 2017 12:37 PM

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. 
 
Regards, 
Srinivasan 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;