Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
120
XamDataGrid Force cell update from Paste even if value is the same
posted

Hello,

I'm using a XamDataGrid and the Copy/paste function.

When I paste on cell a value which is exactly the same than the current one, then my binded property is not updated.

Does it possible to have my property update after the paste even if the value has not changed ?

In my grid some field on different cell could have a specific behavior so I want my binded property is alert even if value is the same.

My version is : 16.2.20162.2237

Thanks by advance.

Parents
No Data
Reply
  • 34430
    Offline posted

    Hello Frederic,

    I am under the impression in this case that you are referring to the XamDataGrid in the Infragistics for WPF product and not our UWP product. If this is the case, I will move the forum thread. If this is not the case, please let me know as the following is based on this impression.

    Currently, the XamDataGrid will not change its underlying bound property if you paste the same value in the cell because put simply, the value is not actually changing. My best recommendation for you on this would be to utilize the ExecutedCommand event of the grid and catch the paste event. You could do that using the following event handler:

    private void XamDataGrid_ExecutedCommand(object sender, Infragistics.Windows.Controls.Events.ExecutedCommandEventArgs e)
    {
         if(e.Command != null && e.Command.Name == "Paste")
         {
               //do something
         }
    }

    In place of the “//do something” above, you could utilize the ActiveCell of the XamDataGrid to find the cell that you pasted into. The resulting Cell can get you the Record it is part of and the Field and should allow you to update your data item.

    Please let me know if you have any other questions or concerns on this matter.

Children