Hello,I have a two copy/paste issues with a XamDataGrid.
I have attached an example that demonstates these issues.
Best regards,
Karol
WpfApp1_issues.zip
Hello,
Thank you for the update. Glad that you are able to find the solution for all your requirement.
Thanks, I have somehow misread your first proposal and interpreted it as a click event hook.
This fixes my fourth issue. This solution is less accurate because I have new line characters inside the cell. This results in the text being surrounded by quotes (an a trailing new line character). So I stay with my KeyBinding solution in that case.
<igDP:XamDataGrid.InputBindings> <KeyBinding Command="{Binding CopyCommand}" Modifiers="Ctrl" Key="C" /> </igDP:XamDataGrid.InputBindings> // https://developercommunity.visualstudio.com/t/Action-Command-implementation-under-C-8/10276543 CopyCommand = new ActionCommand(( ) => { var ac = _dataGrid.ActiveCell; Clipboard.Clear(); Clipboard.SetText((string)ac.Value); });
For your fourth requirement setting CellClickAction would help, like explained earlier:
<igDP:FieldLayout.FieldSettings><igDP:FieldSettings CellClickAction="SelectCell"/></igDP:FieldLayout.FieldSettin
Thank you for the highlight info. It is fine for me.
Regarding the copy issue: In the mean time I found a solution with:
<igDP:XamDataGrid.InputBindings> <KeyBinding Command="{Binding CopyCommand}" Modifiers="Ctrl" Key="C" /> </igDP:XamDataGrid.InputBindings>
I forgot my fourth issue:Clicking the button in cells in column 1 will make it yellow.What is weird, is the fact that I need to click the button twice (except I am already in the cell).
Hello Karol,
To copy the column 1 since its a template field you would have to set CellClickAction to select cell. Like this:
<igDP:FieldLayout.FieldSettings> <igDP:FieldSettings CellClickAction="SelectCell"/> </igDP:FieldLayout.FieldSettings>
Yes i am able to reproduce the new line trailing issue in your sample but not mine. I am investigating it and would update you again with the finding.
To highlight the single cell on hove over we dont have specific property for that , although you can override the default style like this:
<igDP:XamDataGrid.Resources> <Style TargetType="igDP:CellValuePresenter"> <Setter Property="BackgroundHover" Value="LightBlue" /> </Style> <Style TargetType="{x:Type igDP:DataRecordCellArea}"> <Setter Property ="BackgroundHover" Value="Transparent"></Setter> <Setter Property ="BorderBrush" Value="Transparent"></Setter> <Setter Property ="BorderActiveBrush" Value="Transparent"></Setter> <Setter Property ="BorderSelectedBrush" Value="Transparent"></Setter> <Setter Property ="BorderHoverBrush" Value="Transparent"></Setter> </Style> </igDP:XamDataGrid.Resources>