Hi,
We have recently upgraded from Infragistics 2011.1 to 2014.1 and detected an issue with calling Clear() on UltraListView.Items - a NullReferenceException gets thrown at: Infragistics.Win.UltraWinListView.UltraListViewItem.get_TextSizeIconic().
There was previously no issue in that code before. Is this a known but or has something changed in that code?
Thanks!
Hello Rostislav,
Thank you for contacting Infragistics Support.
I have investigated your issue, and found it to be a known issue. This issue was logged in our internal tracking system with Development ID 182922. So I’ve created a case for you CAS-145249-Q3C7W5 and will update you for the progress of this issue via the mentioned case. You could reach your case following the link below:
https://es.infragistics.com/my-account/support-activity
Thank you for using Infragistics Components.
Thanks so much for a quick reply! :)
We will await the fix in the next few weeks. In the meantime - is there any workaround for this that we could use?
Thanks again,
Ross
Thank you for your feedback.
What you can do is before call Clear() method on the UltraListView.Items collection to suspend the layout and set the UltraListView View property to Details. After call Clear you can set back View property and resume the layout. You can do it this way:
private void ButtonClearData_Click(object sender, EventArgs e)
{
UltraListViewStyle currentStyle = this.ultraListView1.View;
this.SuspendLayout();
this.ultraListView1.View = UltraListViewStyle.Details;
this.ultraListView1.Items.Clear();
this.ultraListView1.View = currentStyle;
this.ResumeLayout();
}
Please find attached a sample solution implementing this approach.
Please let me know if this is what you are looking for or if I am missing something.
Wondering if this was ever resolved? Or did it resurface. I'm still getting this error in 17.1. The workaround still works though.
I know this is old but I had a similar problem in 19.1 with SubItemColumns. It was right after I added a custom SortComparer to a SubItemColumn. Removing the comparer removed the error so I added a function to null the sortcompares prior to the clear and that seems to have helped as well.
Craig,
The issue that this thread was originally created for and development issue 182922 was logged for where a NullReferenceException is thrown when calling Clear on the UltraListView.Items collection was resolved and is not reproducible in 18.1.20181.177.
The call stack that Michael provided is different from the original issue and if that is what you are seeing, we need a sample to look into what is happening.
Working properly in 18.1.20181.177