J
Joe Kasta
Here's a tricky question..
I have a a function in a webform that will draw a checkbox in a given area
(note, this is an override of a PaintForeground function, not a drop / drag
of a checkbox from the toolbar).
System.Windows.Forms.ControlPaint.DrawCheckBox(e.Graphics, tempRectangle,
Windows.Forms.ButtonState.Checked)
It's draw in a cell within a grid. I use an AddHandler function to call a
function (Call it Function X) when the cell is clicked. I have also
overridden the onclick function of the cell to redraw the checkbox as
clicked or unclicked, depending on what the previous value was.
The problem is that Function X is called twice each time I click the cell. I
have *throughly* reviewed the code to make sure that I haven't added two
handlers. I have not been.Despite this, a stack trace does seem to indicate
there are two handlers, though my assembly is not so good.
When I draw a checkbox, does it automaticially add a handler? And does that
handler "bubble" up to the cell? If so, can this be prevented? Thank you in
advance.
-J
I have a a function in a webform that will draw a checkbox in a given area
(note, this is an override of a PaintForeground function, not a drop / drag
of a checkbox from the toolbar).
System.Windows.Forms.ControlPaint.DrawCheckBox(e.Graphics, tempRectangle,
Windows.Forms.ButtonState.Checked)
It's draw in a cell within a grid. I use an AddHandler function to call a
function (Call it Function X) when the cell is clicked. I have also
overridden the onclick function of the cell to redraw the checkbox as
clicked or unclicked, depending on what the previous value was.
The problem is that Function X is called twice each time I click the cell. I
have *throughly* reviewed the code to make sure that I haven't added two
handlers. I have not been.Despite this, a stack trace does seem to indicate
there are two handlers, though my assembly is not so good.
When I draw a checkbox, does it automaticially add a handler? And does that
handler "bubble" up to the cell? If so, can this be prevented? Thank you in
advance.
-J