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

Call a javascript function on Grid header client column check or uncheck

2 Answers 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brijendra Kumar
Top achievements
Rank 1
Brijendra Kumar asked on 23 Oct 2008, 05:06 AM

 

 Hi All,


I have a grid. In this grid i have a client select column.
that is being used to select / deselect all the rows of grid.
I want to call  a javascript method when user selects / deselects rows by
clicking on header client select column.

Does any body know how to do it, tell me...

Thanks in advance......    


Brijendra Pandey

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 23 Oct 2008, 05:12 AM
Hi Brijendra ,

Try the following code snippet to achieve the desired scenario.

ASPX:
<telerik:GridClientSelectColumn UniqueName="SelectCol" ></telerik:GridClientSelectColumn> 

CS:
 protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item is GridHeaderItem) 
        { 
            GridHeaderItem header = (GridHeaderItem)e.Item; 
            CheckBox chkbx = (CheckBox)header["SelectCol"].Controls[0]; 
            chkbx.Attributes.Add("onclick", "return Show();"); 
        } 
        
    } 

JS:
<script type="text/javascript" language="javascript" > 
 
  function Show() 
   { 
   } 
</script> 


Regards
Shinu.
0
Brijendra Kumar
Top achievements
Rank 1
answered on 15 Nov 2008, 06:28 AM
Thanks Shinu

Regards

Brijendra
Tags
Grid
Asked by
Brijendra Kumar
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Brijendra Kumar
Top achievements
Rank 1
Share this question
or