RadCalendar for ASP.NET AJAX

RadControls for ASP.NET AJAX

The OnColumnHeaderClick client-side event handler is called when the user is about to select a column of dates by clicking on a column header. The event occurs only if the ShowColumnHeaders and UseColumnHeadersAsSelectors properties are set to true.

Note

The OnColumnHeaderClick event is supported by: RadCalendar.

Two parameters are passed to the event handler:

  • sender is the calendar control.

  • eventArgs has the following properties:

    • get_index() returns the 1-based index of the column that was clicked.

    • get_domElement() returns the DOM element for the column header that was clicked.

    • set_cancel() lets you prevent the click from selecting the column of dates.

The following example uses the OnColumnHeaderClick event to confirm the selection:

CopyASPX
<script type="text/javascript">
    function ConfirmColumnSelection(sender, eventArgs) {
        var msg = "Do you want to change the selection for column " + eventArgs.get_index();
        var title = eventArgs.get_domElement().title;
        if (title != "")
            msg = msg + " (" + title + ")";
        msg = msg + "?";
        eventArgs.set_cancel(!confirm(msg));
    }
</script>
<telerik:RadCalendar ID="RadCalendar1" runat="server">
 <ClientEvents OnColumnHeaderClick="ConfirmColumnSelection" />
</telerik:RadCalendar>

See Also