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

RadTimeView Positioning

1 Answer 62 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Roger
Top achievements
Rank 1
Roger asked on 02 Jun 2009, 04:57 AM
Hi,
I have a RadGrid in a RadWindow that has a couple of time entries in it.
I have a form template with 2 RadTimePiickers on it to enter/edit data & everything is going fine.

However, the RadTimeView is opening in the bottom left of the windo and some of the times are getting cut off by the modal window edge.

What I would like to do is similar to the help file on positioning the time view. The example shows how to do this from a keypress (ie have an OnKeyPress client event in the TimePicker while the button is rendered invisible) but there is nothing to say how to do it from the button press. I was thinking of adding my own button & adding the javascript but how do I get the Telerik button image.

I have found a really good article on finding a control in a form template Access FormTemplate controls from javascript when using UpdatePanel by Ruth Dahan but still having problem with the actual positioning code.

function showStartTimePopUp(sender, eventArgs) {  
            var picker = $find(pickerStartClientID);  
            showTimePopUp(picker, eventArgs);  
        }  
        function showEndTimePopUp(sender, eventArgs) {  
            var picker = $find(pickerEndClientID);  
            showTimePopUp(picker, eventArgs);  
        }  
        function showTimePopUp(picker, eventArgs) {  
            var popup = eventArgs.get_popupControl();  
            var textBox = picker.get_textBox();  
            var popupElement = picker.get_timePopupContainer();  
            var dimensions = picker.getElementDimensions(popupElement);  
            var position = picker.getElementPosition(textBox);  
            picker.showTimePopup(position.x, position.y - dimensions.height);              
        }    

The pickerStartClientID and pickerEndClientID were provided by Ruth's code but all the javascript does is loop. I tried  using a eventArgs.set_cancel(true); in both showStartTimePopUp and showEndTimePopUp but this did nothing.

Any ideas?

Regards
Roger

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 04 Jun 2009, 11:54 AM
Hello Roger,

I am reposting here the reply my colleague Tsvetoslav provided in the support ticket you opened with regards to this subject:

I suppose the help sample you have in mind concerns showing the time picker's pop-up above the input area.  Please, find attached a small sample that demonstrates how to achieve this scenario in RadGrid. Obtaining the functionality in question when the time picker is in a RadGrid is more difficult since there is no easy way in which you can get a reference to the client component of the time picker. For this reason, I have resorted to using jQuery which comes along with the RadControls - you just need to set the script references manually in the ScriptManager control since RadGrid injects the jQuery library only in special cases and RadDateTimePicker and RadTimePicker do not use it at all.

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
Roger
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Share this question
or