Hi,
I am using conditional formatting on some columns in my grid. One of the columns is a date/time column on which I have created a Formula condition such as this:
"datediff( "d" , [//FormulaCondition/ConditionValue] , today() ) > 30"
This condition checks if the date of the column is at least 30 days in the past.
I find when I apply such a condition, the grid performs very slowly in scrolling etc. Also when I save the grid layout with this condition, it changes the UI render time from about 0.4 to 4 seconds.
I have experimented with other date/time functions (such as check if the cell value is equal to a particular date) and get similar poor performance.
Anyone experience this before? is this a bug?
Thanks!
David.
Thanks Mike for all the help
Hi David,
I tested this out and I see the problem. Oddly enough, when I turned on Exception handling, I got an exception. Basically the CalcManager is trying to convert DBNull into a DateTime using the IConvertible interface.
Now, the CalcManager could check for DBNull before attempting the IConvertible conversion. In some cases, that would not be a prudent thing to do, because it's not a good idea to make assumptions about the IConvertible Implementation - since it could theoretically change. But in this case, it's pretty safe for us to do and it would eliminate the slowdown you are getting here.
I'm going to froward your post over to our Developer Support team and ask them to write this up as a bug so we can correct it.
Hi Mike
I have attached a sample app - if you right click on the date/time column you can apply conditional formatting
Then scroll down to the rows with a null value in that column and you will see the slowdown while scrolling past those rows. There is also a slowdown when you load a layout containing such a conditional format (although this is not included in the sample).
Thanks
In that case, I'm not sure why it would be slowing down. It's probably a good idea for your code to check for null, anyway.
If you can create a small sample project demonstrating the issue, I'd be happy to check it out.
I tried as you suggested and no exceptions seemed to be thrown (I verified by throwing my own exception which did break execution).