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. General Programming
  3. C#
  4. simple DataGridView question.

simple DataGridView question.

Scheduled Pinned Locked Moved C#
questioncss
4 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.
  • Z Offline
    Z Offline
    zaboboa
    wrote on last edited by
    #1

    Hi, I have a grid, that has a column of checkboxes. I also have a button outside the grid, that if clicked should toggle the grid view to show only the rows that have checkboxes checked. What whould be the best way to achieve that? Set the grid's datasource to a dataview with the filter set? Any code samples will be really appreciated. Thank you very much. :-D

    E 1 Reply Last reply
    0
    • Z zaboboa

      Hi, I have a grid, that has a column of checkboxes. I also have a button outside the grid, that if clicked should toggle the grid view to show only the rows that have checkboxes checked. What whould be the best way to achieve that? Set the grid's datasource to a dataview with the filter set? Any code samples will be really appreciated. Thank you very much. :-D

      E Offline
      E Offline
      Ennis Ray Lynch Jr
      wrote on last edited by
      #2

      The easiest way is to assign a name attribute to all of the check boxes in the grid that is the same. You can then get a collection returned in javascript and do the assignment without a postback.

      Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
      Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
      Most of this sig is for Google, not ego.

      Z 1 Reply Last reply
      0
      • E Ennis Ray Lynch Jr

        The easiest way is to assign a name attribute to all of the check boxes in the grid that is the same. You can then get a collection returned in javascript and do the assignment without a postback.

        Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
        Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
        Most of this sig is for Google, not ego.

        Z Offline
        Z Offline
        zaboboa
        wrote on last edited by
        #3

        Sorry, I am talking about a Windows forms grid.

        E 1 Reply Last reply
        0
        • Z zaboboa

          Sorry, I am talking about a Windows forms grid.

          E Offline
          E Offline
          Ennis Ray Lynch Jr
          wrote on last edited by
          #4

          On the checkbox click event assign the underlying datasource to have the value alternated and then Rebind or Refresh the datagrid.

          Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
          Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
          Most of this sig is for Google, not ego.

          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