My CurrentCellValue is always null.
I want to mark a row but also if I choose to copy ( Ctrl + C ) a cell I want that value to be copied, now I get the whole row.
<dxg:GridControl
Name="GridControl"
ColumnsSource="{Binding Columns}"
ItemsSource="{Binding Orders}"
ColumnGeneratorTemplate="{StaticResource ColumnTemplate}"
AutoGenerateColumns="None"
ColumnGeneratorStyle="{StaticResource CommonColumnStyle}"
SelectedItems="{Binding SelectedOrders}"
SelectionMode="Row"
CustomSummary="GridControl_OnCustomSum"
SelectionChanged="GridControl_OnSelectionChanged"
CopyingToClipboard="GridControl_OnCopyingToClipboard">
private void GridControl_OnCopyingToClipboard(object sender, CopyingToClipboardEventArgs e)
{
Clipboard.Clear();
Clipboard.SetText(GetRowData());
e.Handled = true;
}
private string GetRowData()
{
return GridControl.CurrentCellValue.ToString();
}
SOLUTION:
<dxg:TableView Name="GridTableView" NavigationStyle="Cell" />
Now I have a value in CurrentCellValue
You can add "SelectedItem" Binding to your GridControl, and in "GridControl_OnCopyingToClipboard" try to find inside the selectedItem the relevant text that you want to copy.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.