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. CUSTOM DATAGRID HELP!

CUSTOM DATAGRID HELP!

Scheduled Pinned Locked Moved C#
databasehelptutorial
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.
  • D Offline
    D Offline
    dgap
    wrote on last edited by
    #1

    Hi guys, I have two checkboxes on my datagrid and I have an event that fires whenever the first checkbox is checked (code follows)... but I don't know how to figure out where (what index) the checkbox that fired the event is coming from!!! Please Help!!! private void cb_CheckedChanged(object sender, EventArgs e) { bool bIsChecked; CheckBox cbTemp = (CheckBox) sender; bIsChecked = cbTemp.Checked; if (bIsChecked && ((CheckBox)this.Items[THE INDEX OF THE SENDER!].Cells[1].Controls[0]).Checked) ((CheckBox)this.Items[THE INDEX OF THE SENDER!].Cells[1].Controls[0]).Checked = false; } Thanks in advance to anyone who helps me out!

    C 1 Reply Last reply
    0
    • D dgap

      Hi guys, I have two checkboxes on my datagrid and I have an event that fires whenever the first checkbox is checked (code follows)... but I don't know how to figure out where (what index) the checkbox that fired the event is coming from!!! Please Help!!! private void cb_CheckedChanged(object sender, EventArgs e) { bool bIsChecked; CheckBox cbTemp = (CheckBox) sender; bIsChecked = cbTemp.Checked; if (bIsChecked && ((CheckBox)this.Items[THE INDEX OF THE SENDER!].Cells[1].Controls[0]).Checked) ((CheckBox)this.Items[THE INDEX OF THE SENDER!].Cells[1].Controls[0]).Checked = false; } Thanks in advance to anyone who helps me out!

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Set the IDs of the checkboxes as you create them, or in databinding, or something. Christian Graus - Microsoft MVP - C++

      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