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
990
Wingrid row Copy/Paste with read only cell
posted

Hi!

I need to allow copy/paste of a row in a wingrid. The problem is that I have 2 cells that are read-only. So when I paste the row, I received an error asking me to continue to copy in the read-only cell or cancel. If I click OK then everything works fine. My question is How can I deactivate this message to always paste (with copy cell content in read-only cells) without warnings and message boxes ?

I looked in the WinGrid Error event and found MultiCellOperationErrorInfo object, but I didn't find the way to correct this behavior.

Best regards,

Benoit

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi Benoit,

    I think you should be able to achieve what you want with something like this:


            private void ultraGrid1_Error(object sender, Infragistics.Win.UltraWinGrid.ErrorEventArgs e)
            {
                if (e.ErrorType == ErrorType.MultiCellOperation)
                {
                    if (e.MultiCellOperationErrorInfo.Operation == MultiCellOperation.Paste &&
                        e.MultiCellOperationErrorInfo.CanContinueWithRemainingCells)
                    {
                        e.MultiCellOperationErrorInfo.Action = MultiCellOperationErrorInfo.ErrorAction.Continue;
                        e.Cancel = true;
                    }
                }
            }


Reply Children