Hi park,
Thank you for your details.
Here we have prepared a sample which illustrates your request. Please download the sample from the below location.
[C# Code]
CommandBinding cb = new CommandBinding(CopyCommand, CopyCommandExecute, CopyCommandCanExecute);
this.CommandBindings.Add(cb);
KeyGesture kg = new KeyGesture(Key.C, ModifierKeys.Control);// KeyGesture kg = new KeyGesture(Key.V, ModifierKeys.Control);
InputBinding ib = new InputBinding(CopyCommand, kg);
this.InputBindings.Add(ib);
textBox.CommandBindings.Add(cb);
textBox.InputBindings.Add(ib);
dataGrid.ModelLoaded += (s, e) =>
{
dataGrid.Model.Grid.CommandBindings.Add(cb);
dataGrid.Model.Grid.InputBindings.Add(ib);
};
}
private void CopyCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
{
e.CanExecute = true;
}
private void CopyCommandExecute(object sender, ExecutedRoutedEventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.ShowDialog();
}
Link:
http://www.syncfusion.com/uploads/redirect.aspx?file=GDCRoutedCommand_52506d37.zip&team=developmentLet us know if you need any details.
Regards,
Muthulakshmi