

Hi,my checkbox iscode behind: Private Sub Chkcity_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Chkcity.CheckedChangedif (Chkcity. Hello.I have two grid on same page.both grid contains header checkbox and item checkbox i want that if use check header checkbox then all item check box checked,i have javascript for this functinality but problem is that when i click on header check box of first grid then checkbox of second grid also checked that i dnt want i want to perform this operation on one grid at one time.i have attache my script z help me.thanks function SelectAll(ID) &nbs.Ĭhecking checkbox is checked or not using checkbox.checked function popWin() Ĭheck All Check Box While Check Header CheckBox Step 1 1 ForiegnkeyTest.aspx one web form Load Text box of one web form with selected list item of list box of another web form Items(i).Selected = CBool(objDr("Active")) ' Active is a boolean field in my database tableĬhkBoxLst. Add(New ListItem(objDr("Title").ToString, objDr("id").ToString)) ' Title and id are fields in my database table ' This variable will represent the index of the list-item to be added Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _ĭim objDr As SqlDataReader = someFunction Protected WithEvents chkBoxLst As CheckBoxList
#Xyplorer invert selection code#
As the code loops through each record, a boolean field is assigned to the Selected property of the CheckBoxList list-item.įor your version, just replace the sqldatareader with your datatable and loop through the datatable manually. Below is some code that manually adds items to to a CheckBoxList control by looping through a DataReader. It looks like you have to bypass the databind method of adding items to the CheckBoxList.
