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

client side row selection

1 Answer 84 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Naresh
Top achievements
Rank 1
Naresh asked on 03 Dec 2008, 07:39 AM
Hi,
I have a grid with some preselected items, and now when i click on a row the previous selections lost. i checked the following thread, it helped a bit not completely.
http://www.telerik.com/community/forums/aspnet-ajax/grid/row-selection-question.aspx

i am using client select column. allowing multiple row selection.


1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 08 Dec 2008, 02:24 PM
Hello Naresh,

Most easiest way to prevent the unwanted behavior is to disable the selection on row click and use only the check boxes instead.
<script type="text/javascript" language="javascript"
    function RowDeselecting(sender, args) 
    { 
        if (args.get_domEvent().target) 
        { 
            if (args.get_domEvent().target.type != "checkbox"
                args.set_cancel(true); 
        } 
        else if (!args.get_domEvent().srcElement) 
            args.set_cancel(true); 
    } 
</script> 

<ClientEvents OnRowDeselecting="RowDeselecting" OnRowSelecting="RowDeselecting" /> 

Otherwise you will have to use cumbersome workarounds to avoid the problems under in the different browsers.

Best regards,
Daniel
the Telerik team

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