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. check box in grid view

check box in grid view

Scheduled Pinned Locked Moved ASP.NET
css
3 Posts 3 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.
  • P Offline
    P Offline
    ptvce
    wrote on last edited by
    #1

    i have gridview and one of thats column are checkboxes. if i check the top of the check box all of the check boxes checked. but if i paging it and set it that show 5 items in each page just checked 5 checkboxes in first page . but i want all of the checkboxes checked in other pages too.

    J S 2 Replies Last reply
    0
    • P ptvce

      i have gridview and one of thats column are checkboxes. if i check the top of the check box all of the check boxes checked. but if i paging it and set it that show 5 items in each page just checked 5 checkboxes in first page . but i want all of the checkboxes checked in other pages too.

      J Offline
      J Offline
      John Gathogo
      wrote on last edited by
      #2

      You most probably, you should create an event that updates the datasource for the GridView (particularly the field that is updated with the checkmark value) when you check mark your checkbox. Otherwise, it is not like the other pages exist. They are generated as you move from one page to the next - on demand.

      1 Reply Last reply
      0
      • P ptvce

        i have gridview and one of thats column are checkboxes. if i check the top of the check box all of the check boxes checked. but if i paging it and set it that show 5 items in each page just checked 5 checkboxes in first page . but i want all of the checkboxes checked in other pages too.

        S Offline
        S Offline
        saanj
        wrote on last edited by
        #3

        Hi, You have to maintain the gridview's data in a datatable which itself should be stored in a viewstate. If the requirement permits you then in checkbox's click event just maintain a flag in the datatable. Otherwise, do it in the PageIndexChanged event of the grid. But, you also need to check the actual row index of the datable which will be dependant to the Per Page data count and the row no. in the data page. Just check it.

        Either you love IT or leave IT...

        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