| | |
vb.net: How to check or uncheck all chekboxes by clicking only one checkbox.
Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Dec 2008
Posts: 43
Reputation:
Solved Threads: 1
0
#2 Nov 2nd, 2009
hey
i have found solution of my problem. . solution involve javascript so that page should not postback.
im posting it so that somebody else can benefit from it.
In the code behind
i have found solution of my problem. . solution involve javascript so that page should not postback.
im posting it so that somebody else can benefit from it.
ASP.NET Syntax (Toggle Plain Text)
<script type="text/javascript"> function SelectAll(id) { var frm = document.forms[0]; for (i=0;i<frm.elements.length;i++) { if (frm.elements[i].type == "checkbox") { frm.elements[i].checked = document.getElementById(id).checked; } } } </script>
In the code behind
ASP.NET Syntax (Toggle Plain Text)
Protected Sub grdDeletedADs_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles grdDeletedADs.RowDataBound Try If (e.Row.RowType = DataControlRowType.Header) Then DirectCast(e.Row.FindControl("chkAllRows"), CheckBox).Attributes.Add("onclick", "javascript:SelectAll('" & _ DirectCast(e.Row.FindControl("chkAllRows"), CheckBox).ClientID & "')") End If Catch ex As Exception lblerror.Text=ex.Message End Try End Sub
![]() |
Similar Threads
- Check or uncheck items in a checkbox list, based on information from database (ASP.NET)
- Check/ Uncheck boxes in Word 2003 (Windows NT / 2000 / XP)
- Check/uncheck checkboxes in TreeView using javascript (ASP.NET)
- Problem in uncheck the checkBox (VB.NET)
- check\uncheck all checkboxes in datalist control (ASP.NET)
- How to overcoming a .NET ListView CheckBoxes quirk (VB.NET)
- select check boxes (ASP.NET)
- checkbox in datagridview c# (C#)
Other Threads in the ASP.NET Forum
- Previous Thread: urgent: Passing ArrayList in session..
- Next Thread: session varible from 1 page to another
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 activexcontrol advice ajax alltypeofvideos anathor asp asp.net bc30451 bottomasp.net browser button c# c#gridviewcolumn checkbox child click commonfunctions compatible confirmationcodegeneration content contenttype courier css dataaccesslayer database datagridview datagridviewcheckbox datalist deadlock development dgv dropdown dropdownlist edit expose feedback flash flv form formatdecimal forms formview google grid gridview homeedition hosting iframe iis javascript jquery list listbox login menu microsoft mono mouse mssql multistepregistration news numerical objects panelmasterpagebuttoncontrols project radio ratings richtextbox rotatepage save schoolproject search security serializesmo.table silverlight smartcard sql-server sqlserver2005 suse textbox tracking typeof unauthorized validation vb.net video videos view virtualdirectory vista visual-studio visualstudio web webarchitecture webdevelopemnt webservice xml youareanotmemberofthedebuggerusers





