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

How to highlight or show the current time in time popup of Raddatetimepicker

1 Answer 155 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ram
Top achievements
Rank 1
Ram asked on 01 Dec 2011, 05:35 AM
Hi all,
Im using Raddatetimepicker in my application.
I'm able to highlight the current date in calender using special days property.
But I need to show the current time also in Time picker.
I'm able to show only timeformat like either 12 or 24 hours.
But how can I show the current time in timepicker and highlight the current time.
Please help me to accomplish this asap.
Thanks

1 Answer, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 05 Dec 2011, 12:27 PM
Hi Ram,

Unfortunately the RadDateTimePicker does not support the desired functionality. However you could achieve it by using some custom code. For example you could try handling the OnPopupOpening event, iterate over all time view's cells and highlight the current time cell:
<telerik:RadDateTimePicker runat="server" ID="RadDateTimePicker1">
<ClientEvents OnPopupOpening="OnPopupOpening" />
<telerik:RadCodeBlock runat="server" ID="RadCodeBlock1">
    <script type="text/javascript">
        function OnPopupOpening(sender, eventArgs) {
            var childs = sender.get_timeView().get_element().childNodes;
            for (var i = 0; i < childs.length; i++) {
                if (childs[i].nodeName.toUpperCase() == "TABLE") {
                    //iterate over all table cells and highlight the current time's cell.
                    break;
                }
            }
        }
    </script>
</telerik:RadCodeBlock>

I hope this helps.

All the best,
Radoslav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
General Discussions
Asked by
Ram
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Share this question
or