this.datagrid.SelectionController = new SelectionControllerExt(this.datagrid);
public class CurrentCellManager : GridCurrentCellManager
{
public CurrentCellManager(SfDataGrid grid) : base(grid)
{
}
internal void SetSuspendAndResumepdates(Action suspendupdates, Action resumeupdates)
{
SuspendUpdates = suspendupdates;
ResumeUpdates = resumeupdates;
}
public override void ProcessOnTapped(MouseButtonEventArgs e, RowColumnIndex currentRowColumnIndex)
{
if (dataGrid.EditTrigger == EditTrigger.OnTap && e.ChangedButton != MouseButton.Right)
base.ProcessOnTapped(e, currentRowColumnIndex);
if (CurrentRowColumnIndex == currentRowColumnIndex)
{
if (!(this.dataGrid is DetailsViewDataGrid))
ScrollInView(currentRowColumnIndex);
}
}
}
public class SelectionControllerExt : GridSelectionController
{
public SelectionControllerExt(SfDataGrid dataGrid) : base(dataGrid)
{
}
protected override GridCurrentCellManager CreateCurrentCellManager()
{
CurrentCellManager currentcellmanager = new CurrentCellManager(DataGrid);
currentcellmanager.SetSuspendAndResumepdates(SuspendUpdates,ResumeUpdates);
return currentcellmanager;
}
} |