Hello,
I've noticed some strange behavior with the WebDateChooser control when its visibility property is changed while it is inside a WebAsyncRefreshPanel. The control appears but the user cannot select a date. To duplicate this behavior, create a web form and add the following code.
<asp:Button ID="Button1" runat="server" Text="Show WebDateChooser" onclick="Button1_Click" /> <br /><br /> <igmisc:WebAsyncRefreshPanel ID="WebAsyncRefreshPanel1" runat="server" TriggerControlIDs="Button1"> <igsch:WebDateChooser ID="WebDateChooser1" runat="server" Visible="false"/> </igmisc:WebAsyncRefreshPanel>
Then add the following event handler to the codebehind file:
protected void Button1_Click(object sender, EventArgs e) { WebDateChooser1.Visible = true; }
Run the project, then click the "Show WebDateChooser" button. The WebDateChooser control will appear but will not function.
I've also attached a sample project to illustrate this issue. In the sample project, the WebDateChooser control is part of a simple composite control (but this doesn't appear to matter).
I would log this issue with Developer Support so that they may log it with development. You can log an issue here:
http://devcenter.infragistics.com/Protected/SubmitSupportIssue.aspx
The behavior you see is a symptom of the scripts not being brought in. As for workarounds, you can place the button inside of the WARP that has the webdatechooser. When doing so, make sure you clear the TriggerControlIDs property that references the button. I am not sure why it works but probably has to do with where the postback initiated. Another workaround is to place a webdatechooser on the form outside of the WARP with a style tag of display:none. This would render the control and just hide it from view and at the same time would bring in the scripts necessary to have the dropdown function. Alternatively you can just add the following script tags into your page to make sure it is available when the control is rendered. When doing so, make sure to copy the appropriate scripts to the correct directories in your application.
<script src="scripts/ig_shared.js" type="text/javascript"></script>
<script src="scripts/ig_webdropdown.js" type="text/javascript"></script>
<script src="scripts/ig_calendar.js" type="text/javascript"></script>
Hello Sung Kim,
Thanks for your reply. I have already submitted this to developer support, but I thought someone on the forums may have noticed this as well.
You mentioned three possible workarounds. I can't use the first two, because my situation is actually a little different and a lot more complex than the one I illustrated in my original post (I used that situation because it demonstrates simply and directly what looks to me like a possible bug). I am using composite server controls that, at run-time, may or may not include the WebDateChooser and other Infragistics data controls (such as WebNumericEdit, etc), depending on what the user does.
I suspected this might be related to scripts not being brought in, but I didn't know what to do about that. Your third suggestion, therefore, I believe should work. I'll try it out. Again, thanks!
Ken