Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
215
SelectedDateChanged event not calling when date is selected
posted

Hi,

Iam using Infragistics WebMonthCalendar control for displaying calendar.Here,Iam facing problem while calling SelectedDateChanged event through c#.net in Infragistics WebMonthCalendar.

Here is code


protected override void OnInit(EventArgs e)
    {
        DropDownList.SelectedIndexChanged += new EventHandler(DropDownList_SelectedIndexChanged);
  

      WebMonthCalendar.SelectedDateChanged += new CalendarSelectedDateChangedEventHandler(WebMonthCalendar_SelectedDateChanged);       
        base.OnInit(e);
    }


protected void WebMonthCalendar_SelectedDateChanged (object sender, CalendarSelectedDateChangedEventArgs e)
    {             
        //Code
    }


protected void ddCalCulture_SelectedIndexChanged(object sender, EventArgs e)
    {
       //code
    }


Dropdown SelectedIndexChanged event is working fine.However in infrgistics,it  was not calling SelectedDateChanged event when Iam selecting the dates.

I have already tried replacing protected with Public,private/void.But No Luck.

Please help in this case.

  • 24497
    Suggested Answer
    posted

    Hi,

    I tested your codes and they worked as expected.

    However, to see a server event you need a postback. You may drop a Button on page, change selection and click that button to submit. If you want automatic submit on selection change, then you should enable AutoPostBackFlags.SelectionChanged (in designer or in codes). Below is example.

     protected override void OnInit(EventArgs e)
     {
      this.WebMonthCalendar1.AutoPostBackFlags.SelectionChanged = Infragistics.Web.UI.AutoPostBackFlag.On;
      this.WebMonthCalendar1.SelectedDateChanged += new CalendarSelectedDateChangedEventHandler(WebMonthCalendar_SelectedDateChanged);
      base.OnInit(e);
     }