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

[Solved] DateInput onclick Problem

1 Answer 123 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 22 Apr 2009, 09:20 PM
*ADMIN - Can you please move this to the Grid forum, as it's not just the datepicker with this problem. This problem exists in the grid.

I have a usercontrol being used for my radgrid insert/edits. It's defined like so:
<EditFormSettings UserControlName="~/_controltemplates/OKS/EstimateAdd.ascx" EditFormType="WebUserControl"
                        <EditColumn UniqueName="EditCommandColumn1"
                        </EditColumn> 
                    </EditFormSettings> 


Within the user control exists a RadDatePicker. WIthin that datpicker I have the following tag:
<DateInput onclick='<%= DatePickerID %>' DateFormat="D"

I have the following property that populates that onclick:
public string DatePickerID 
        { 
            get { return "ToggleSecondPopup('" + dpRequiredEstimateCompletion.ClientID + "');"; } 
        } 

My togglepopup js function:
function ToggleSecondPopup(id) { 
    $find(id).showPopup(); 


Immediately after the datepicker control I have a cancel button:
<asp:Button runat="server" Text="Cancel" CommandName="Cancel" ID="cmdCancel" /> 



Now, my onclick will work for dropping down the calendar control when I first hit the page. However, if I cancel the insert with my cancel button, and go back to insert another record again, my $find has come back empty. I've checked and the id value is absolutely correct. I can do a getElementById and get the DOM object, but of course I still have no reference to the calendar component or it's showPopup method. I thought it might just be the DateInput onclick problem, but upon further inspection, even the calendar button doesn't work at that point. Here is my complete calendar code:
<telerik:RadDatePicker ID="dpRequiredEstimateCompletion" Style="vertical-align: middle;" Width="200px" 
                    runat="server" DatePopupButton-ImageUrl="/images/calendar.gif" DatePopupButton-HoverImageUrl="/images/calendar.gif"
                    <DateInput onclick='<%= DatePickerID %>' DateFormat="D"
                    </DateInput></telerik:RadDatePicker> 

Thank you in advance!

EDITED TO SAY: I've duplicated this functionality in the Template mode  as well. Also, after the cancel and hit "Add new Record", none of the controls are working correctly (my RadComboBox no longer works).

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 27 Apr 2009, 11:28 AM
Hello Michael,

My colleague Georgi already provided an answer to your question in the support ticket you opened with regards to this subject. I am posting his reply (along with the sample project) in this forum thread as well:

Unfortunately I could not reproduce this issue. I created a test project in my attempt to recreate the abnormality explained so far. I used the latest official build of RadControls. I've attached my sample web site project to this support thread. Please examine it and tell me if I am missing something in your logic.

Best regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Calendar
Asked by
Michael
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Share this question
or