Home Forums WinForms controls Xceed Grid for WinForms Canceling in EnteringEdit causes crash

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #13024 |

    <em>I wired up the EnteringEdit event and have it call:</em>

    private void cell_EnterEdit(object sender, EnteringEditEventArgs e)
    {
    e.Cancel = true;
    }

    <em>This runs, but the moment flow leaves the function I get:</em>

    An unhandled exception of type ‘System.Reflection.TargetInvocationException’ occurred in mscorlib.dll

    Additional information: Exception has been thrown by the target of an invocation.

    <em>Any ideas? I’m just trying to block the editing of the string in this cell.</em>

    Imported from legacy forums. Posted by Dustin_00 (had 1876 views)

    User (Old forums)
    Member
    Post count: 23064

    Ah-ha!

    I was wiring up the call to cell_EnterEdit twice:

    row.Cells[ “Item” ].EnteringEdit += new EnteringEditEventHandler( this.cell_EnterEdit );
    row.Cells[ “Item” ].Value = item;
    row.Cells[ “Item” ].Tag = “I” + id;
    row.Cells[ “Item” ].AccessibleDescription = description;
    row.Cells[ “Item” ].AccessibleName = accessName;
    row.Cells[ “Item” ].EnteringEdit += new EnteringEditEventHandler( this.cell_EnterEdit );

    Now it works beautifully.

    Imported from legacy forums. Posted by Dustin_00 (had 2937 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.