I''m optimizing performance in an application and
find that the DateTimePickerExt (DateTimePickerAdv) is extremely slow compared to
other controls on our forms.
Some of the forms have many controls and we have too long loading time of these. When profiling I see that the DateTimePicker is responsible for ~80-90% of the time in a form with ~30 controls.
Almost all of the time is in the datetimepicker and down in get_Calendar etc. even though I haven''t dropped it.
This is on both 126.96.36.199 and 188.8.131.52.
How can we make this initialization time shorter?
Will this be fixed later in version 2.
We are looking on version 2 since it shall have better menu performance.
ADAdministrator Syncfusion Team January 14, 2004 10:19 AM
Thanks for bringing this to our attention. This problem occurs only when the DateTimePicker is added to the Form through the designer, since in this case the Calendar control gets created eventhough it is not in use. The Calendar control in the DateTimePickerExt/DateTimePickerAdv internally uses a GridControl. Hence the initialization time of this Control is considerably high when compared to our other controls.
The workaround here would be comment out/remove all the designer generated code related to the DateTimePickerAdv''s Calendar in the Form''s InitializeComponent method. This would ensure that the Calendar is not created initially when the application loads and hence the application initialization time would be minimized to a great extent. Please try this and let me know if this meets your requirements.
SLStefan LundbergJanuary 15, 2004 07:10 AM
I have tested this by commenting out the calendar related code and got improved performance, thanks.
I haven''t done the final solution where this code is applied later on (when dropping the calendar..?) since I guess it is needed then.
ps. Maybe this change should be done in the Syncfusion Tools.. ds.
ADAdministrator Syncfusion Team January 15, 2004 09:12 AM
You do not have to explicitly add code to create a DateTimePickerAdv Calendar at a later stage when you wish to use the dropdown Calendar. This is code will be generated automatically. However, the Calendar display is slightly slower for the first time since it takes time for initialization and JIT compiling. But it works fine for the subsequent usages. Please let me know if you need any other information. We appreciate your feedback on this issue.
SLStefan LundbergJanuary 16, 2004 01:42 AM
Hi and thanks for your response.
I''ve checked more on this and with your current implementation I have to reinitiate a number of values when the popup is shown (MonthCalendarExt). Even though these are set initially.
We do some customizations, null button, max/min dates etc but I cannot understand the implementation in DateTimePickerExt.
In all properties there are checks for this ''this.monthCalendar!=null'', ok that''s fine.
There is a store ''DateTimePickerExtCalendarStore'' that holds these values but the store isn''t updated correctly.
See methods ''InitializeCalendarStore'', ''InitializePopup'', ''EnableNullDate'', ''MinValue'', ''MaxValue'' (etc).
Why isn''t this.cStore updated?
When the popup is initialized old data is used.
As I see it the intended functionality doesn''t work and I have to implement what I have described in previous posts.
SLStefan LundbergJanuary 16, 2004 06:58 AM
The problem I find is that the None button is shown even though I''ve set that is shouldn''t be.
I''ve added this code and want your opinion if this is correct or not. Have I misunderstood the
complete problem and is doing something wrong?
(sorry about word wraps)
protected override void OnOnPopup(System.EventArgs e)
// We have delayed our creation of the dropdown calendar to get faster form loads.
// Syncfusion does though not initialize the calender correctly so we need this code
// to set some properties again..
// See this post: http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=9862 (''Performance of DateTimePickerExt'')
if( !this.m_calendarInitialized )
this.m_calendarInitialized = true;
base.EnableNullDate = !base.EnableNullDate;
base.EnableNullDate = !base.EnableNullDate;
// base.MinValue = base.MinValue;
// base.MaxValue = base.MaxValue;
Don''t know if Min/MaxValue is a problem but it is handled incorrect as EnableNullDate.
ps. OnBeforePopup doesn''t work, check line 2405-2406 in DateTimePickerExt (184.108.40.206). ds.
ADAdministrator Syncfusion Team January 16, 2004 12:12 PM
Thanks for the information, and for the code snippet above. I have consulted the Essential Suite development team regarding this issue. We will further investigate this and I will keep you posted on the developments. We appreciate your patience, and thanks for your feedback.
ADAdministrator Syncfusion Team January 19, 2004 08:17 AM
All of the above mentioned issues have been taken care of now, and the fixes will be available in the next build of Essential Suite. Please open an incident in DirectTrac in this regard, and I will update you there with further details on these problems and the fixes. We appreciate your cooperation, and thanks for considering Syncfusion products.
SSSimon StorrFebruary 16, 2004 07:09 AM
The performance hit for us anyway is due to it throwing up a silent exception
for the DateTimePicketExt dtpDate -
this.dtpDate = new Syncfusion.Windows.Forms.Tools.DateTimePickerExt();
A first chance exception of type ''System.FormatException'' occurred in mscorlib.dll
Additional information: Input string was not in a correct format.
Commenting out this line throws up the same exception the first time dtpDate.Calendar is referenced, in this case -
this.dtpDate.Calendar.AllowSelection = Syncfusion.Windows.Forms.Grid.GridSelectionFlags.None;
ADAdministrator Syncfusion Team February 16, 2004 05:11 PM
Thanks for bringing this to our attention. However we could not observe any exceptions when we tested for this issue using our latest release, v220.127.116.11. Several related fixes/improvements have been performed on the DateTimePickerExt since the release of v18.104.22.168, our last 1.6 build. If you are using an earlier version please create an incident in DirectTrac in this regard, and I will update you with the download instructions for v22.214.171.124. Thanks for coooperation.
CACarlApril 5, 2004 04:07 AM
I´ve seen a related bug to this problem. When we comment out all the calendar code before popup we get a crash if we press the enter or escape key. This is because you override ProcessCmdKey and check "popupWindow.IsShowing()" even though popupWindow isn´t initialized. We are about to release an application built on ver 126.96.36.199 could we get a patch to fix this problem?
ADAdministrator Syncfusion Team April 5, 2004 11:35 AM
Thanks for opening an incident in DirectTrac in this regard. I will update you there from now on. We appreciate your interest in Syncfusion products.