Philip Senechal
Top achievements
Rank 1
Philip Senechal
asked on 21 Apr 2008, 07:11 PM
I just noticed that I have a small problem with a date picker popup that resides in a grid cell with in-line editing on. The first time you edit a row, the date picker works fine. However, if you update the row or cancel the update, the next row you edit (even if it's the same one), throws the following javascript error:
'this._calendar' is null or not an object
I have the popup assignment in the RadGrid1_ItemCreated event
and the JavaScript is this
Can you tell me what I'm doing wrong? I'm assuming that the grid is doing a postback when I update or cancel and maybe the reference to 'this' is no longer valid? Thanks for the help.
'this._calendar' is null or not an object
I have the popup assignment in the RadGrid1_ItemCreated event
| Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) |
| If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then |
| Dim picker As RadDatePicker = TryCast(e.Item.FindControl("dp_scout_dob"), RadDatePicker) |
| If picker IsNot Nothing Then |
| picker.MaxDate = DateTime.Now |
| picker.DateInput.Attributes("onclick") = String.Format("showPopUp('{0}');", picker.ClientID) |
| picker.SharedCalendar = Master.sharedCalendar |
| End If |
| End If |
| End Sub |
and the JavaScript is this
| <script type="text/javascript"> |
| function showPopUp(id) |
| { |
| $find(id).showPopup(); |
| } |
| </script> |
Can you tell me what I'm doing wrong? I'm assuming that the grid is doing a postback when I update or cancel and maybe the reference to 'this' is no longer valid? Thanks for the help.
7 Answers, 1 is accepted
0
Hello Philip,
You should use the ItemDataBound event to set the picker's SharedCalendar. Please, give it a go and let us know if the error is resolved.
All the best,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
You should use the ItemDataBound event to set the picker's SharedCalendar. Please, give it a go and let us know if the error is resolved.
All the best,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Philip
Top achievements
Rank 1
answered on 22 Apr 2008, 05:35 PM
I moved the code over to the ItemDataBound event and it still produces the Javascript error. The interesting thing is that I have another code block in this procedure that adds a "Select an Item" to a dropdown in the grid and it works perfectly every time...so it looks like the event is firing off as it should. And it's interesting that it works the first time I edit a row in the grid, but not in subsequent edits.
You know...I don't think this was an issue with the 2007.3 Prometheus release. It might just be since I upgraded to 2008.1. I can test that out if you like.
You know...I don't think this was an issue with the 2007.3 Prometheus release. It might just be since I upgraded to 2008.1. I can test that out if you like.
0
Hi Philip,
Please, find my test sample attached. It functions as expected on my end with the official 2008.1.415 version.
Let me know if that helps.
All the best,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Please, find my test sample attached. It functions as expected on my end with the official 2008.1.415 version.
Let me know if that helps.
All the best,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Philip Senechal
Top achievements
Rank 1
answered on 23 Apr 2008, 04:36 PM
I made some minor changes to my code to match yours, but I still get the Javascript error. If I remove the AjaxManager and allow the page to do a postback, it works fine. So I think it has something to do with possibly losing the ID of the datepicker or the calendar when doing the Ajax callback.
I may have to wrap it up and send it to you in a support ticket because I just can't seem to figure out where the problem is.
I may have to wrap it up and send it to you in a support ticket because I just can't seem to figure out where the problem is.
0
Hello Philip,
Unfortunately I have no idea what might be the difference in your scenario.
Feel free to submit a regular support ticket sending a runnable sample, which replicates the error. You can refer this forum thread within the description. As soon as we review and debug the project, we will get back to you with our findings.
All the best,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Unfortunately I have no idea what might be the difference in your scenario.
Feel free to submit a regular support ticket sending a runnable sample, which replicates the error. You can refer this forum thread within the description. As soon as we review and debug the project, we will get back to you with our findings.
All the best,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Philip Senechal
Top achievements
Rank 1
answered on 24 Apr 2008, 04:19 PM
You're going to love this :) I got the same error using the exact files you gave me.
The problem is either Operating System specific or Web Server specific. The problem is occurring on my Windows Vista laptop using the development web server that comes with Visual Studio 2008. This is where the problem occurs with both IE7 and Firefox.
Now when I copied the files over to the production server running Win2k3 and IIS, it works fine. Unfortunately, I'm not able to test whether the problem will occur when using Windows Vista against the production server of Win2k3 and IIS since I can't put a Vista computer on our network. So I'll leave that determination up to you guys.
Bottom line though is that their is either a problem with Vista or Visual Studio 2008 when running this code.
Thanks for helping me work through that issue.
The problem is either Operating System specific or Web Server specific. The problem is occurring on my Windows Vista laptop using the development web server that comes with Visual Studio 2008. This is where the problem occurs with both IE7 and Firefox.
Now when I copied the files over to the production server running Win2k3 and IIS, it works fine. Unfortunately, I'm not able to test whether the problem will occur when using Windows Vista against the production server of Win2k3 and IIS since I can't put a Vista computer on our network. So I'll leave that determination up to you guys.
Bottom line though is that their is either a problem with Vista or Visual Studio 2008 when running this code.
Thanks for helping me work through that issue.
0
Hello Philip,
That sounds strange. Actually there are no many reports concerning issues occurring only on specific environments (especially OS related). In most cases it appears to be something from another installed software or browser related problem.
We will test the sample on another machines as well. If you find anything else, which could help us isolate the problem, please let us know.
Regards,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
That sounds strange. Actually there are no many reports concerning issues occurring only on specific environments (especially OS related). In most cases it appears to be something from another installed software or browser related problem.
We will test the sample on another machines as well. If you find anything else, which could help us isolate the problem, please let us know.
Regards,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center