This is a migrated thread and some comments may be shown as answers.

RadDatePicker and RadAjaxPanel error

2 Answers 91 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Evgeniy
Top achievements
Rank 1
Evgeniy asked on 28 Jan 2009, 01:09 PM
Hi, all!

I used two RadDatePicker (dpBegin and dpEnd) in RadAjaxPanel. Necessary when I changed selected date in dpBegin, then change 

dpEndDate.Calendar.RangeMinDate. It necessary that user can't select date in dpEnd less than date in dpBegin. I make following:

aspx

<telerik:RadAjaxPanel ID="ajaxSeasonsPanel" runat="server" HorizontalAlign="NotSet">  
 
<telerik:RadDatePicker ID="dpBegin" runat="server" Width="150px" EnableTyping="False" AutoPostBack="True" OnSelectedDateChanged="dpBegin_SelectedDateChanged">  
  <DateInput ReadOnly="True" AutoPostBack="True">  
  </DateInput> 
  <Calendar Skin="WebBlue" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x">  
  </Calendar> 
  <DatePopupButton CssClass="radPopupImage_WebBlue" HoverImageUrl="~/Images/DatePicker.png" ImageUrl="~/Images/DatePicker.png" /> 
</telerik:RadDatePicker> 
 
<telerik:RadDatePicker ID="dpEnd" runat="server" Width="150px" EnableTyping="False">  
  <DateInput ReadOnly="True" Width="">  
  </DateInput> 
  <Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x">  
  </Calendar> 
  <DatePopupButton CssClass="radPopupImage_WebBlue" HoverImageUrl="~/Images/DatePicker.png" ImageUrl="~/Images/DatePicker.png" /> 
</telerik:RadDatePicker> 
 
</telerik:RadAjaxPanel 

cs

protected void dpBegin_SelectedDateChanged(object sender, Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e)  
{  
        dpEnd.SelectedDate = dpBegin.SelectedDate;  
        dpEnd.Calendar.RangeMinDate = e.NewDate.Value;  

If I wait some time, then It work wonderful. But if I change selected date in dpBegin and instantly click on popup button of dpEnd then Browser fired javascript error:
Error: [Exception... "'Sys.InvalidOperationException: Sys.InvalidOperationException: Component 'ctl00_RoundPanel_ContentPlaceHolder1_RoundPanelTab4_dpEndDate_calendar' was not found.' when calling method: [nsIDOMEventListener::handleEvent]"  nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)"  location: "<unknown>"  data: no]

sometimes fired following error:
Error: this.CurrentViews is null

Any ideas?

Thanks!

2 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 02 Feb 2009, 09:42 AM
Hi Evgeniy,

As you are updating the ComboBox via ajax, you need to wait for the ajax request to finish before trying to access it. Otherwise you might end up with an error exception. Try adding RadAjaxLoadingPanel to your page so you better see when the ajax request has finished.

I hope this helps.

All the best,
Iana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Evgeniy
Top achievements
Rank 1
answered on 02 Feb 2009, 09:50 AM
Thanks,

I have already solved the problem using the same RadAjaxLoadingPanel too :)

Tags
Calendar
Asked by
Evgeniy
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Evgeniy
Top achievements
Rank 1
Share this question
or