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

GridClientSelectColumn

2 Answers 156 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sanoj
Top achievements
Rank 1
Sanoj asked on 14 Dec 2009, 02:43 PM
Is it possible to hide the (de)select-all checkbox in the radgrid header and place a generic checkbox with similar functionality outside the radgrid?

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 15 Dec 2009, 04:56 AM
Hi Sanoj,

Here is the CSS for hiding the checkbox in header for the GridClientSelectColumn.

CSS:
 
    <style type="text/css"
        .RadGrid_Default .rgCheck 
        { 
            displaynone !important; 
        } 
    </style> 

Try the following code for equivalent functionality using checkbox.

aspx:
 
 <asp:CheckBox ID="CheckBox2" runat="server" onclick="selectAll(this);" /> 

javascript:
 
<script type="text/javascript"
    function selectAll(checkbox) { 
        var masterTable = $find("<%=RadGrid1.ClientID%>").get_masterTableView(); 
        if (!checkbox.checked) { 
            masterTable.clearSelectedItems(); 
        } 
        else { 
            masterTable.selectAllItems(); 
        } 
    } 
</script> 
 

-Shinu.
0
monte
Top achievements
Rank 1
answered on 13 Feb 2012, 06:51 PM
Thanks for the post, this was incredibly helpful and exactly what our business owners requested.  I did notice that the CSS removed the checkbox but the background for the checkbox header area reverted to gray (instead of white for the other column headers) and also didn't reserve the space it normally occupied causing the other headers to shift to the left.  I modified the CSS slightly to correct for this:

.RadGrid_Default .rgCheck input
{
    visibility: hidden !important;
}
Tags
Grid
Asked by
Sanoj
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
monte
Top achievements
Rank 1
Share this question
or