Certain applications in windows may lock the Windows clipboard for extended periods of time. I have noticed grid.PerformAction(ToggleRowSel) will throw an exception if this clipboard is locked. This only seems to occur if DisplayLayout.Override.AllowMultiCellOperations includes AllowMultiCellOperation.Paste. If you set AllowMultiCellOperations = AllowMultiCellOperation.Default this will not occur.
If you look at the exception stack trace of the PerformAction, it is calling CurrentState which calls some method that checks the clipboard which inturn throw an exception if the Clipboard is locked. You would assume PerformAction does't nesscarily need any external exception handling everytime it's called because it returns a boolean, but after looking though the Grid code it seems there is no exception handling in any of these methods in the grid stack trace. Just wanted to get Infragistics' take on this....?
Attached is a project that demos this.
See the exception:
Thanks for the response. I have submitted this as an issue.
As a quick fix I have wrapped all calls to grid.PerformAction() in try/catch (in another method). This will work but looking at the call stack the CurrentState method will exersize the problem as well. There are probably quite a few places in the Grid code that call CurrentState, I would hate to have to wrapp all calls to the grid in a try/catch just because other applications might be locking the Windows clipboard.
An exception definitely shouldn't be thrown just for this, so you should submit this to Developer Support so that it can be fixed and you can be notified when the fix is released.
-Matt