If you call the closeup() method on a additional button in a combo since the Microsoft updates KB3023222 KB3023224 this throws an exception:
An unhandled exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll
Additional information: Operation is not valid due to the current state of the object.
Removing the updates resolves the issue but of course leaves the end user open to the vulnerabilities the patch is supposed to fix.
This issues occurs in .net 4 / 4.5 / 4.5.1 with infragistics 14.1
To replicate add a combo to your form add a month calendar to your form. Add a buttonright to your combo of type drop down and select the month calendar as the control.
Add an event on date selection to close the drop down and it will throw the error.
private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e) { var btn = (Infragistics.Win.UltraWinEditors.DropDownEditorButton)ultraCombo1.ButtonsRight[0]; btn.CloseUp(); }
I have attached a sample project file that replicates the issue
But thew
private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e)
{
var btn = (Infragistics.Win.UltraWinEditors.DropDownEditorButton)ultraCombo1.ButtonsRight[0];
btn.CloseUp();
}
Updating to 15.1 seems to resolve the issue, can anyone else confirm this?
Hi,
Thank you for your replies.
I was able to install the patch and I reproduced the issue. I tested it with the version that the sample application uses (14.1) and the RTM version of 15.1 (15.1.20151.1000) and the latest service release of 15.1 (15.1.20151.2013) and with all the versions I got the exception. I logged the issue in our internal issue tracking system with ID of 194198.
@Barney, with what service release of 15.1 you weren’t able to reproduce the issue? Since I was able to reproduce it with the latest service release I have opened a private case for you (CAS-155831-W2D7P6). This way you will be notified as soon as the issue is fixed.
@Jon, it seems that you already have a private case for this issue (CAS-155800-B1S7L6), so I will link it to the development issue and you will also be notified as soon as the issue is fixed.
You can view your active support cases if you follow this link:
https://es.infragistics.com/my-account/support-activity
Please let me know if you have any additional questions.
Has this been fixed now ?
Hi Vivek,
No, this is not fixed. In fact, this may not be fixable on our end. The DateTimeEditor is basically getting it's Windows Handle re-created while it's in the middle of processing a mouse message.
I recommend using the workaround. It's very easy and it should fix the problem.
I'm getting the error in a Wingrid in the CellChange Event, when I call grid.PerformAction(UltraGridAction.ExitEditMode); after choosing a date in a date column.
(didn't check other dropdowns in the grid because they just get enabled after the date selection)
Can you please provide the according invoke solution for wingrid?
Thx in advance
Tobi
ok found an answer myself, was quite simple
private delegate void delegateExitEditMode(); private void grid_CellChange(object sender, CellEventArgs e) { BeginInvoke(new delegateExitEditMode(exitEditMode)); } private void exitEditMode() { grid.PerformAction(UltraGridAction.ExitEditMode); }
Yep. That's exactly the way to do it. :)