I am using Infragistics v19.2 and facing an InvalidOperationException on using RowFilter in ultrawingrid.
The exception occurs on click of filter icon. The error reads:
System.InvalidOperationException: Failed to compare two elements in the array. ---> System.ArgumentException: Object must be of type DateTime.
The column on which it throws error contains mixed data (string and datetime).
I am attaching a sample .net code and Excel file to use for your convenience to easily reproduce the issue.
7585.RowfilterFileID.xlsx
It does not allow to upload files having size greater than 1 MB; so I could not upload the code. But I am attaching the excel file which contains the data to load in grid and then simply click on filter icon on ID column to reproduce the issue.
Hello Sukhminder,
Thank you for posting to Infragistics community.
I have been looking into your question and created a small sample in an effort to reproduce the described behavior. However, I will need some additional information regarding your scenario to further investigate this.
My questions are: How are you loading the data into the grid? What data type are you setting for the “ID” column?
Since it usually makes sense for a column to represent a single data type, it is a bit confusing what this “ID” column is aiming to represent. In the sample, I have added an UltraDataSource for the grid with two columns: “Rank” of type “int” and “ID” of type “object”. I chose the object type, since it can represent any class type, DateTime and int, in this case. I have manually added 4 data rows as from the provided Excel sheet. Using this approach, I am not able to reproduce the exception on clicking the filter icon.
Attached you will find my sample for your reference. Please test it on your side and let me know how it behaves. If this is not an accurate demonstration of what you are trying to achieve please feel free to modify it and send it back to me. In order to upload it with the allowed file size, you will have to remove the “bin” and “obj” folders from the project directory and zip the application.
Thank you for your cooperation.
Looking forward to hearing from you.
Regards,Bozhidara PachilovaAssociate Software Developer
4670.UGFilterExc.zip