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

MultiSelect only in ColumnHeaders click

3 Answers 26 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Ricardo
Top achievements
Rank 1
Ricardo asked on 27 Oct 2008, 04:24 PM
Hi,
I need the MultiSelect property allowed only when the user clicks in a ColumnHeader...is it possible?

thanks

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 27 Oct 2008, 05:53 PM
Hello Ricardo,

Test this approach and let me know whether it works as expected:
<script type="text/javascript" language="javascript"
    function RowSelecting(sender, args) 
    { 
        if (!args.get_domEvent().type) 
            args.set_cancel(true); 
 
        if (args.get_domEvent().target && args.get_domEvent().target.type == "checkbox"
            args.set_cancel(true); 
    } 
</script> 

Regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ricardo
Top achievements
Rank 1
answered on 27 Oct 2008, 06:17 PM
it causes a jscript error in this line:
if (!args.get_domEvent().type)

I call your function in ClientEvents-OnDateSelecting="RowSelecting" of RadCalendar...is it correct ?
0
Daniel
Telerik team
answered on 29 Oct 2008, 01:18 PM
Hello Ricardo,

The proposed solution was for RadGrid, excuse me for the confusion.

You can find an appropriate example for RadCalendar below:
<script type="text/javascript" language="javascript"
    var allow; 
    function DateSelecting(sender, args) 
    { 
        if (!allow) 
            args.set_cancel(true); 
    } 
 
    function AllowClick(sender, args) 
    { 
        allow = true
    } 
 
    function DateClick(sender, args) 
    { 
        allow = false
    } 
</script> 

<telerik:RadCalendar ID="RadCalendar1" runat="server" Font-Names="Arial, Verdana, Tahoma" 
    ForeColor="Black" Style="border-color: #ececec"
    <ClientEvents OnDateSelecting="DateSelecting" OnDateClick="DateClick" OnRowHeaderClick="AllowClick" 
        OnColumnHeaderClick="AllowClick" /> 
</telerik:RadCalendar> 

I hope this helps.

Regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Calendar
Asked by
Ricardo
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Ricardo
Top achievements
Rank 1
Share this question
or