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. WPF
  4. DataGrid - CheckBox selection from Code.

DataGrid - CheckBox selection from Code.

Scheduled Pinned Locked Moved WPF
tutorial
2 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.
  • N Offline
    N Offline
    Nanda_MR
    wrote on last edited by
    #1

    Hi Developer, I am using one select All Button to select all row in Datgrid (CheckBox selection). So how to Check CheckBox in Datagrid. Regards Nanda.

    P 1 Reply Last reply
    0
    • N Nanda_MR

      Hi Developer, I am using one select All Button to select all row in Datgrid (CheckBox selection). So how to Check CheckBox in Datagrid. Regards Nanda.

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      In the collection that you are binding to, you have a collection of items. Each item is an instance of an object that represents a single row. Add a property to this that represents whether or not it has been checked, make it raise the PropertyChanged event and bind your Checked to this. Finally, when the user clicks select all, simply iterate over the collection and set the checked property to true. With the wonder of data binding, the UI will also update.

      Forgive your enemies - it messes with their heads

      My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

      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