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

[Solved] Checkbox column ,checked ,unchecked

1 Answer 130 Views
Grid
This is a migrated thread and some comments may be shown as answers.
hamid mn
Top achievements
Rank 1
hamid mn asked on 05 Oct 2009, 08:55 PM

Hi , I have a column type of  GridClientSelectColumn  , now how can access to checkbox in every row in this column , and how can checked,unchecked  them with client side way (in javascript function)

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 06 Oct 2009, 05:56 AM
Hello Hamid,

You could use the set_selected() method in order to select/deselect the rows which in turn check/uncheck the corresponding checkboxes. See the example shon below.

JavaScript:
 
<script type="text/javascript"
    function Select() { 
        var grid = $find('<%= RadGrid1.ClientID %>'); 
        var MasterTable = grid.get_masterTableView(); 
        // This will select all the rows 
        for (var i = 0; i < MasterTable.get_dataItems().length; i++) { 
            MasterTable.get_dataItems()[i].set_selected(true); // Give parameter false for deselecting the row 
        } 
    } 
</script> 

-Shinu.
Tags
Grid
Asked by
hamid mn
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or