datagrid checkbox events

  • Thread starter Thread starter fred
  • Start date Start date
F

fred

hiya,

I have got a checkbox in one of my cells in the ediit
item template. Now i need to enable/disable a
textbox in another boundcolumn.

the problem i am facing is the checkchanged event is not
raised or for some reason, the control does not enter the
function. I have made the function as protected and
specified the function name in the html for the checkbox
but i still do not get an event.

is this possible, what is wrong here

fred
 
eliyahu,

How can i enable/disable the textbox in my boundcolumn
from a control in another column

thanks for your help
 
Checkchanged event doesn't cause postback, it is raised if the checkbox
value changed between postbacks.

Eliyahu
 
Do you mean you have a checkbox in one column and want to enable/disable a
textbox in another? If it's the case, I recommend doing it on client side
with a javascript function. Add a client-side onclick event to the checkbox.
In the event handler function find and enable/disable the textbox. This is
the fastest solution, no round trips involved. There is a number of things
you have to know though. To add a client-side event handler use Attributes
properties of the checkbox. Do it for every data row in the grid's
ItemDataBound event handler. Good luck.

Eliyahu
 
Eliyahu,

I seem to abe able to get an event on the checkbox when
I set AutoPostBack to true and I can have the logic for
enable/disable in the event.


Fred
 
Fred,

That is fine for the quick start. My experience with ASP.NET also started
from 99% of code on the server side. Now the percentage is much less because
of dramatic performance improve that you gain by eliminating unnecessary
round trips.

Eliyahu
 
Back
Top