I've got a grid that's bound to a Data Table in a Dataset and has lots of string columns plus one Date/Time column. As soon as the Date/Time column scrolls into view the grid slows right down (scrolling and screen refresh).
If I scroll down to an area with no values in the date/time column then the grid speeds up again. If I hide the date/time column (using the column chooser) then the performance is fine.
The only properties I've changed for the column are the captions and the Mask Input (set to {date} {longtime}). I've tried with Mask Input blank but it still has the same problem.
I've only seen this problem after upgrading from VS2008 + Infragistics 2008 vol 2 to VS2010 + Infragistics 2010 (10.3.20103.2063).
Thanks,
John.
Hi John,
My guess is that the slowdown is occurring because the grid has to convert some other type to and from a DateTime and this is causing exceptions which are being caught and handled internally.
What is the DataType of the Date/Time column? Is it System.DateTime? Or some other type?
If it is a DateTime, then try setting Visual Studio to break on all run-time exceptions and see if there are exceptions occurring when you scroll the column into view. If so, the call stack of the exceptions may give us a clue about why this is happening.
Hi Mike,
The Data Type of the column is System.DateTime and I don't get any exceptions when I enable break on Thrown exceptions (nothing appears in the output window either).
I've tried knocking together a test form to see if I get the same problem but if there is any performance difference with the date/time column then it's not visible to the human eye. The grid that shows the problem has around 100 columns (although a lot of those are marked as hidden) so the problem might only show up on a large grid.
If there are no exceptions and it's not a DataType issue, then the only other thing I can think of is that it's something in your code - maybe some code in the InitializeRow, or a DrawFilter or CreationFilter you are using?
If that does not help, then there's not much more I can think to tell you without a sample. Maybe you could create a sample by starting with a copy of your real project and reducing it, rather than building a sample from the ground up?
Ah, that's interesting. I've seen that happen before. If you have a resource that contains an empty string, the designer will go an assume that that resource should be used for every place in the application that uses an empty string.
I'm still a little fuzzy on why that was slowing down your application, but I guess if the problem is solved, all's well that ends well. :)
I've managed to get to the bottom of the problem. The Windows Forms desginer had, in its infinte wisdom, decided to set the Grid Column Format property to a random resource file entry found elsewhere in the project (I beleive this happens when you have a resource file with no text in it).
Anyway, I removed the line setting the format property from the designer file and it's back to full speed again. The actual date/time format used int he grid is being set using MaskInput, which it's setting using Apply Resources.