If you want to do it in xaml I think that you need at least to re-template the grid or the cell.
But if you are ok with a little code-behind:
- Add and handler for the
MouseDoubleClick
event for the RadGrid
and then:
private void RadGridView_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
FrameworkElement originalSender = e.OriginalSource as FrameworkElement;
if (originalSender != null)
{
var cell = originalSender.ParentOfType<GridViewCell>();
if (cell != null)
{
cell.Background = new SolidColorBrush(Colors.Red);
}
}
}
Edit:
Subscribe to the PreparedCellForEdit
event and:
private void RadGridView_PreparedCellForEdit(object sender, GridViewPreparingCellForEditEventArgs e)
{
var editingControl = e.EditingElement as Control;
if(editingControl !=null)
editingControl.Background = new SolidColorBrush(Colors.Red);
}