MultiSelect only in ColumnHeaders click

4 posts, 0 answers
  1. Ricardo
    Ricardo avatar
    2 posts
    Member since:
    Oct 2008

    Posted 27 Oct 2008 Link to this post

    Hi,
    I need the MultiSelect property allowed only when the user clicks in a ColumnHeader...is it possible?

    thanks
  2. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 27 Oct 2008 Link to this post

    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.
  3. Ricardo
    Ricardo avatar
    2 posts
    Member since:
    Oct 2008

    Posted 27 Oct 2008 Link to this post

    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 ?
  4. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 29 Oct 2008 Link to this post

    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.
Back to Top