|
this.datagrid.SelectionController = new CustomSelectionController(this.datagrid);
public class CustomSelectionController : GridSelectionController
{
public CustomSelectionController(SfDataGrid dataGrid)
: base(dataGrid)
{
}
protected override void ProcessKeyDown(KeyEventArgs args)
{
// Get the CurrentCell column index
var currentColumnIndex = this.CurrentCellManager.CurrentRowColumnIndex.ColumnIndex;
base.ProcessKeyDown(args);
if (SelectionHelper.CheckShiftKeyPressed())
return;
if (args.Key == Key.F2)
{
//Do your actions here
}
}
} |
|
protected override void ProcessKeyDown(KeyEventArgs args)
{
// Get the CurrentCell column index
var currentColumnIndex = this.CurrentCellManager.CurrentRowColumnIndex.ColumnIndex;
base.ProcessKeyDown(args);
if (SelectionHelper.CheckShiftKeyPressed())
return;
if ((SelectionHelper.CheckControlKeyPressed()&& args.Key == Key.B) ||
(SelectionHelper.CheckAltKeyPressed() && SelectionHelper.CheckControlKeyPressed() && args.Key == Key.A) || (args.Key == Key.F2))
{
//Do your actions here
}
} |