Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. udatecommand datagrid

udatecommand datagrid

Scheduled Pinned Locked Moved ASP.NET
designhelpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    robmays
    wrote on last edited by
    #1

    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()); } :(:(

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups