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. listview check box change event

listview check box change event

Scheduled Pinned Locked Moved ASP.NET
help
5 Posts 2 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.
  • M Offline
    M Offline
    Member 3879881
    wrote on last edited by
    #1

    Hi i am using list view control in my form, In that itemtemplate i used checkbox..., Now that check box check change event i have to capture..., I searched in google but i didnt get ,help me regarding that

    Thanks & Regards, NeW OnE, please don't forget to vote on the post

    I 1 Reply Last reply
    0
    • M Member 3879881

      Hi i am using list view control in my form, In that itemtemplate i used checkbox..., Now that check box check change event i have to capture..., I searched in google but i didnt get ,help me regarding that

      Thanks & Regards, NeW OnE, please don't forget to vote on the post

      I Offline
      I Offline
      Icarus123
      wrote on last edited by
      #2

      what i would do is: add a button after the listview, and in the button_click event, go through the list view, row for row, and then use the : CheckBox box = (CheckBox)Row.FindControl(CheckBoxID) if (box.checked) { } else { }

      M 1 Reply Last reply
      0
      • I Icarus123

        what i would do is: add a button after the listview, and in the button_click event, go through the list view, row for row, and then use the : CheckBox box = (CheckBox)Row.FindControl(CheckBoxID) if (box.checked) { } else { }

        M Offline
        M Offline
        Member 3879881
        wrote on last edited by
        #3

        ya thats ok,. i cant able to get the selected checkbox row cell value..., This is my code: string getchoice11 = null; string chval = null; int loop11 = 0; CheckBox chkHeader = sender as CheckBox; for (int i = 0; i < lvEmployee.Items.Count; i++) { CheckBox chk = lvEmployee.Items[i].FindControl("ICheck") as CheckBox; if (chk.Checked == true) { getchoice11 += "'" + lvEmployee.Items[1].ToString().Trim() + "',"; } } Thanks & Regards, NeW OnE, please don't forget to vote on the post

        I 1 Reply Last reply
        0
        • M Member 3879881

          ya thats ok,. i cant able to get the selected checkbox row cell value..., This is my code: string getchoice11 = null; string chval = null; int loop11 = 0; CheckBox chkHeader = sender as CheckBox; for (int i = 0; i < lvEmployee.Items.Count; i++) { CheckBox chk = lvEmployee.Items[i].FindControl("ICheck") as CheckBox; if (chk.Checked == true) { getchoice11 += "'" + lvEmployee.Items[1].ToString().Trim() + "',"; } } Thanks & Regards, NeW OnE, please don't forget to vote on the post

          I Offline
          I Offline
          Icarus123
          wrote on last edited by
          #4

          Why not use the following: foreach( ListViewItem lvi in lvEmployee.Items) { CheckBox chk = (CheckBox)lvi.FindControl("ICheck"); if (chk.Checked) { getchoice11 += lvi[1].ToString().Trim() + ","; } }

          M 1 Reply Last reply
          0
          • I Icarus123

            Why not use the following: foreach( ListViewItem lvi in lvEmployee.Items) { CheckBox chk = (CheckBox)lvi.FindControl("ICheck"); if (chk.Checked) { getchoice11 += lvi[1].ToString().Trim() + ","; } }

            M Offline
            M Offline
            Member 3879881
            wrote on last edited by
            #5

            getting error as this place: getchoice11 += "'"+ lvi[2].ToString().Trim() + ","; Cannot apply indexing with [] to an expression of type 'System.Web.UI.WebControls.ListViewItem'

            Thanks & Regards, NeW OnE, please don't forget to vote on the post

            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