9 Ocak 2013 Çarşamba

RadGrid: to disable select-all checkbox in header

In order to disable (or make invisible) the select-all checkbox, the following javascript may be used:
the javascript code:
 <telerik:RadCodeBlock ID="RadCodeBlock" runat="server">  
     <script type="text/javascript">  
       function DisableAllSelectOption(sender, eventArgs) {  
         var prefix = sender.ClientID.substring(0, sender.ClientID.lastIndexOf("_"));  
         document.getElementById(prefix + '<%= "_GridOgrenciDersListe_ctl00_ctl02_ctl00_ClientSelectColumnSelectCheckBox"%>').style.visibility = 'hidden';  
       }  
  </script>  
   </telerik:RadCodeBlock>  
radgrid:
 <telerik:RadGrid AutoGenerateColumns="False" ID="GridOgrenciDersListe" AllowFilteringByColumn="false"  
     AllowPaging="False" AllowSorting="False" runat="server" ShowGroupPanel="false"  
     Width="560px" AllowMultiRowSelection="True" ShowFooter="false" Visible="false">  
     <PagerStyle Mode="NextPrevAndNumeric" />  
     <GroupingSettings CaseSensitive="false" />  
     <ClientSettings EnableRowHoverStyle="true">  
       <Selecting AllowRowSelect="True" UseClientSelectColumnOnly="true"></Selecting>  
       <ClientEvents OnRowSelected="RowSelectionChanged" OnRowDeselected="RowSelectionChanged"  
         OnDataBound="RowSelectionChanged" OnGridCreated="DisableAllSelectOption"/>  
     </ClientSettings>  
     <MasterTableView TableLayout="Fixed" DataKeyNames="ID" Font-Size="XX-Small" ClientDataKeyNames="ID">  
       <Columns>  
         <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn">  
         </telerik:GridClientSelectColumn>  
 </Columns>  
     </MasterTableView>  
   </telerik:RadGrid>  

Hiç yorum yok:

Yorum Gönder