udatecommand datagrid
-
all works well until i get to my chlInterest control, i find the control no problem but it wont give me the correct values when the user checks some of the boxes, cavity,loft,draftproofing,heating and other are always false. where am i going wrong??? protected void dtgBooker_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { DataGridItem Item = dtgBooker.SelectedItem; // get data to save DropDownList surveyor = (DropDownList)e.Item.Cells[4].Controls[1]; int surveyorID = Convert.ToInt32(surveyor.SelectedValue); Label leadID = (Label)e.Item.Cells[3].Controls[1]; int ID = Convert.ToInt32(leadID.Text); int myC = e.Item.Cells[9].Controls.Count; CheckBoxList chlInterest = null; chlInterest = (CheckBoxList)e.Item.Cells[9].Controls[1]; bool cavity = chlInterest.Items[0].Selected; bool loft = chlInterest.Items[1].Selected; bool draftProofing = chlInterest.Items[2].Selected; bool heating = chlInterest.Items[3].Selected; bool other = chlInterest.Items[4].Selected; this.dtgBooker.SelectedIndex = -1; this.dtgBooker.EditItemIndex= -1; this.refreshData(this.ddlBooker.SelectedValue.ToString()); } :(:(