I have added a WebDateChooser to a WebControl. I noticed that I had to specify the image directories in order to get the arrow to show up, something I didn't have to do when using it in a TemplatedColumn. Anyway, everything shows up as it should, but nothing happens when I click on it.
My code is as follows:
mDateChooser = new Infragistics.WebUI.WebSchedule.WebDateChooser();mDateChooser.JavaScriptFileName = "Infra/ig_webscheduleinfo.js";mDateChooser.JavaScriptFileNameCommon = "Infra/ig_shared.js";mDateChooser.ID = string.Format("mDateChooser_{0}", this.Parameter.IteratorValue);mDateChooser.Width = Unit.Percentage(100);mDateChooser.Format = Infragistics.WebUI.WebSchedule.DateFormat.Short;mDateChooser.ImageDirectory = "Images/";mDateChooser.DropButton.ImageUrl1 = "ig_cmboDownXP1.png";mDateChooser.DropButton.ImageUrl2 = "ig_cmboDownXP2.png";
I'm kind of assuming that it's the javascript file. I've tried all that seem right, and I don't know how to specify more than one. Thanks.
Javascript files are typically registered in the PreRender phase, and this might explain the problem to some extent - maybe they never have a chance to be registered, since RenerControl is called by Render, which occurs later in the cycle.
If you are creating a composite control, I suggest moving the code to the CreateChildControls methods (you can override the base WebControl.CreateChildControls method) - this method is automatically called by the framework and is the recommended way by Microsoft for these types of scenarios.
Otherwise, you can try moving the code in other events, like OnInit or OnLoad and see if you get better results.
Please, let me know if this helps.
I should have been more clear, and I apologize for that.
The code I posted is run in the parent control constructor, and is just being rendered via RenderControl().