I have in my database days, which are not buisness dates(sundays, holidays).
I want to mark this days in red, in the date picker.
How can I do it?
Hello drpoalim,A similar question has been asked in our community and an answer form the developer has been provided. Please visit the following forum thread - http://forums.infragistics.com/forums/t/45550.aspx
I am new to asp.net.
The suggestion is to work on CalendarRenderDay, Javascript function.
The buisness days, are in my database.
How do I get the list of the days into the JS, in a way which is effiient?
Hello drpoalim,I saw you have sent me an email with a picture and excel table. Thats a hierachical grid with template filtering. You have a filter field by days right? There it should not be a problem to apply the scenario with the Month calendar. It should be closed when you pick a date.
I need to fill the custom dates, based on the values of Other controls on the form
(The user chooses currencies, and I show the holidyd specifically for this currencies)
I tried to catch the CustomButtonClick. I surround the WebMonthCalendar with UpdatePanel, So
I dont get full postback:
<ig:WebDatePicker ID="WebDatePicker1" runat="server" DropDownCalendarID="WebMonthCalendar1" OnCustomButtonClick="WebDatePicker1_CustomButtonClick"> <AutoPostBackFlags CustomButtonClick="On" /> </ig:WebDatePicker> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <ig:WebMonthCalendar ID="WebMonthCalendar1" runat="server" OnVisibleMonthChanged="WebMonthCalendar1_VisibleMonthChanged"> <AutoPostBackFlags VisibleMonthChanged="On" /> </ig:WebMonthCalendar> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="WebDatePicker1" EventName="CustomButtonClick" /> </Triggers> </asp:UpdatePanel>
The code behind is :
protected void WebDatePicker1_CustomButtonClick(object sender, EventArgs e) { }
(For the test, I didnt add the code that adds the custom days yet)
The problem is, when I press the Custom button, I get error:
htmlfile: Member not found.
Also the date picker seems to close and doesnt leave the WebmonthCalendar open.
Hello drpoalim,
The sample is providing an issue because you are trying to set in update panel a control which is contained in another control and the update is done through the parent. Furthermore if the code was not giving this issue the picker would be closing die to postback on click of the button. Please take a look at the attached from me sample which makes __doPostback() on the client and then sets random custom dates in the code behind.
But in your sample, the whole page will be rendered.
It doesnt look nice.
Also for me best is to fill the dates on Visible month changed, and CustomButtonClick, because then
I know which custom days I need.
I could put the both controls, in the same update panel.
The problem is as you say, that the mothcalendar will close.
Is it possible to reopen it in the code behind?
I have contacted our development team regarding this scenario. I will get back to you as soon as they answer to me.
Hello drpoalim,Please let me know if you have any other questions related to the issue.
Great!
That works now.
Thanks.
Hello drpoalim,Did you have the chance to take a look at my last attached sample? You are trying to set the visible month by giving a string variable as an argument. It expects to invoke the function with a variable of type “Date”. var tmp = ig_controls.WebMonthCalendar1.get_visibleMonth();
tmp.setYear(2011);
tmp.setMonth(0);
ig_controls.WebMonthCalendar1.set_visibleMonth(tmp);
Please use this code as a template and set the year and the month according to the value that is kept in the hidden variable “CalendarVisibleMonth”.
I added a field
<input id="CalendarVisibleMonth" type="hidden" runat="server" /> in the code behind I set it:
CalendarVisibleMonth.Value ="1, 1, 2011";
But I dont manage to get the date from the field.
The following function doesnt work:
function WebMonthCalendar1_Initialize(sender, eventArgs) { ///<summary> /// ///</summary> ///<param name="sender" type="Infragistics.Web.UI.ControlMain"></param> ///<param name="eventArgs" type="Infragistics.Web.UI.EventArgs"></param> var hide = document.getElementById("Hidden1"); if (hide.value == "true") { ig_controls.WebDatePicker1.setCalendarOpened(true); hide.value = "false"; var tmp = document.getElementById("CalendarVisibleMonth"); ig_controls.WebMonthCalendar1.set_visibleMonth(tmp); } }
Hello drpoalim,Please take a look at the attached from me sample. I modified the initialize javascript function and I am setting there a visible month January 2011. However the selected day is still today. I tested it in IE 9, FF 10 and Chrome and in all the browsers I get as a visible month the one I am setting in the event.