CUSTOM DATAGRID HELP!
-
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!
-
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!
Set the IDs of the checkboxes as you create them, or in databinding, or something. Christian Graus - Microsoft MVP - C++