Geeks With Blogs
AzamSharp Some day I will know everything. I hope that day never comes.

Selecting checkboxes inside the GridView control is a very common operation and that is why I have several articles and videos dedicated to this subject.

Selecting CheckBoxes Inside GridView With a Twist

VIDEO: Selecting CheckBoxes Inside GridView

Recently, I was playing around with JQuery library and thought of implementing the same scenario using the library. Here is the code used to perform the SelectAll and DeSelectAll function.

<script language="javascript" type="text/javascript">

        // I don't like this line!    
        this.checked = !(this.checked == true);
        $("#gvCategories input:checkbox").attr("checked",function()
            this.checked = !(this.checked == true);

Yup! that's all the code you need to perform this operation. If you think you can even refactor this out then please post your refactorings at Selecting CheckBoxes Inside the Table.

Posted on Saturday, May 10, 2008 10:52 AM | Back to top

Comments on this post: Select All CheckBoxes in GridView Using JQuery

# re: Select All CheckBoxes in GridView Using JQuery
Requesting Gravatar...
Thanks. Helped allot
Left by KM Web Design Blog Melbourne on May 11, 2008 3:10 AM

Your comment:
 (will show your gravatar)

Copyright © Mohammad Azam | Powered by: