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
630
WebDatePicker ValueChanged Event question
posted

I have a datepicker linked to a calendar control as follows:

 

 

 

 

<

 

ig:WebDatePicker ID="StartDate" DropDownCalendarID="StartDate_WebMonthCalendar" runat="server" OnEnterKeyPress="NewFilter" OnValueChanged="NewFilter" AutoPostBackFlags-ValueChanged="On" AutoPostBackFlags-EnterKeyDown="On" > </ig:WebDatePicker>

 

<ig:WebMonthCalendar ID="StartDate_WebMonthCalendar"  runat="server"> </ig:WebMonthCalendar>

My question is that when the dropdown Calendar appears and I select a new date, the new date appears in the WebDatePicker textbox. I would  then expect a valuechanged event to fire but it doesn't. What I had to do is move the OnValueChange and AutoPostbackFlags-ValueChanged to the WebMonthCalendar control and in the Server-side event handler sync the two control's date/selecteddate.

Is this the way its supposed to work or am I missing something?

Parents
  • 19693
    Verified Answer
    posted

    Hello Chris,

     

    If you want to handle every change of the WebMonthCalendar's value you  should use

    OnSelectedDateChanged

    <ig:WebMonthCalendar ID="WebMonthCalendar1" runat="server" Height="200px"

    OnSelectedDateChanged ="WebMonthCalendar1_SelectedDateChanged"

    Width ="225px">

    <AutoPostBackFlags SelectionChanged="On" />

    </ig:WebMonthCalendar >

     

    protected void WebMonthCalendar1_SelectedDateChanged(object sender, Infragistics.Web.UI.EditorControls.CalendarSelectedDateChangedEventArgs e)

    {

    WebDatePicker1.Date = e.NewDate;

    }

     

    Otherwise you have to click otside of the WebDatePicker in order to fire the OnValueChanged event

    <ig:WebDatePicker ID="WebDatePicker1" runat="server"

    DropDownCalendarID="WebMonthCalendar1"

    onvaluechanged ="WebDatePicker1_ValueChanged">

    <AutoPostBackFlags ValueChanged="On" />

    </ig:WebDatePicker >

     Let me know if you need more assistance regarding this.

Reply Children
No Data