Hi Dov,
Thank you for contacting Syncfusion support.
We have analyzed your query.
Query 1: “Copy & paste the selected item between two SfDataGrid ”.
If you want to copy and paste the selected item between two datagrid, you can achieve your requirement by setting GridCopyPaste.Copy() and GridCopyPPaste.Paste() method. When we copy and paste the selected item in another grid, you need to specific index to be paste the record. Could you please refer the below code snippet and sample in below location,
Code Snippet:
private void Button_Click(object sender, RoutedEventArgs e)
{
var currentCell = gridA.SelectionController.CurrentCellManager.CurrentCell;
var record = this.gridA.GetRecordAtRowIndex(currentCell.RowIndex);
this.gridA.SelectedItem = record;
gridA.GridCopyPaste.Copy();
// need to specific the index to paste the record in grid
this.gridB.SelectionController.MoveCurrentCell(new Syncfusion.UI.Xaml.ScrollAxis.RowColumnIndex(currentCell.RowIndex,currentCell.ColumnIndex),true);
gridB.GridCopyPaste.Paste();
}
|
Query 2: “To change row background and foreground colors upon selecting a row and then pressing of a button”
You can achieve your requirement by enabling RowSelectionBrush and SelectionForegroundBrush property. Please refer the below code snippet,
private void Button_Click_1(object sender, RoutedEventArgs e)
{
gridB.RowSelectionBrush = new SolidColorBrush(Colors.Bisque);
gridB.SelectionForegroundBrush = new SolidColorBrush(Colors.Red);
}
|
Please let us know if you have any query.
Regards,
Muthukumar K